@aa-sdk/core 4.0.0-beta.1 → 4.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -308,5 +308,19 @@ export declare class LocalAccountSigner<T extends HDAccount | PrivateKeyAccount
308
308
  *
309
309
  * @param {Hex} key The private key in hexadecimal format
310
310
  * @returns {LocalAccountSigner<PrivateKeyAccount>} An instance of `LocalAccountSigner` initialized with the provided private key
311
- */ static privateKeyToAccountSigner(key: Hex): LocalAccountSigner<PrivateKeyAccount>;
311
+ */
312
+ static privateKeyToAccountSigner(key: Hex): LocalAccountSigner<PrivateKeyAccount>;
313
+ /**
314
+ * Generates a new private key and creates a `LocalAccountSigner` for a `PrivateKeyAccount`.
315
+ *
316
+ * @example
317
+ * ```ts
318
+ * import { LocalAccountSigner } from "@aa-sdk/core";
319
+ *
320
+ * const signer = LocalAccountSigner.generatePrivateKeySigner();
321
+ * ```
322
+ *
323
+ * @returns {LocalAccountSigner<PrivateKeyAccount>} A `LocalAccountSigner` instance initialized with the generated private key account
324
+ */
325
+ static generatePrivateKeySigner(): LocalAccountSigner<PrivateKeyAccount>;
312
326
  }
@@ -1,5 +1,5 @@
1
1
  import {} from "viem";
2
- import { mnemonicToAccount, privateKeyToAccount } from "viem/accounts";
2
+ import { generatePrivateKey, mnemonicToAccount, privateKeyToAccount, } from "viem/accounts";
3
3
  /**
4
4
  * 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.
5
5
  */
@@ -140,9 +140,26 @@ export class LocalAccountSigner {
140
140
  *
141
141
  * @param {Hex} key The private key in hexadecimal format
142
142
  * @returns {LocalAccountSigner<PrivateKeyAccount>} An instance of `LocalAccountSigner` initialized with the provided private key
143
- */ static privateKeyToAccountSigner(key) {
143
+ */
144
+ static privateKeyToAccountSigner(key) {
144
145
  const signer = privateKeyToAccount(key);
145
146
  return new LocalAccountSigner(signer);
146
147
  }
148
+ /**
149
+ * Generates a new private key and creates a `LocalAccountSigner` for a `PrivateKeyAccount`.
150
+ *
151
+ * @example
152
+ * ```ts
153
+ * import { LocalAccountSigner } from "@aa-sdk/core";
154
+ *
155
+ * const signer = LocalAccountSigner.generatePrivateKeySigner();
156
+ * ```
157
+ *
158
+ * @returns {LocalAccountSigner<PrivateKeyAccount>} A `LocalAccountSigner` instance initialized with the generated private key account
159
+ */
160
+ static generatePrivateKeySigner() {
161
+ const signer = privateKeyToAccount(generatePrivateKey());
162
+ return new LocalAccountSigner(signer);
163
+ }
147
164
  }
148
165
  //# sourceMappingURL=local-account.js.map
@@ -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;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAO7B;;;;;;;;;;;;;;OAcG;IACH,YAAY,KAAQ;QAlBpB;;;;;WAAS;QACT;;;;;WAAmB;QAsBnB;;;;;;;;;;;;;;WAcG;QACM;;;;mBAAoE,CAC3E,OAAO,EACP,EAAE;gBACF,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;YAC7C,CAAC;WAAC;QAEF;;;;;;;;;;;;;;;;;;;WAmBG;QACM;;;;mBAAgB,KAAK,EAI5B,MAAqD,EACvC,EAAE;gBAChB,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAC1C,CAAC;WAAC;QAEF;;;;;;;;;;;;;WAaG;QACM;;;;mBAAa,KAAK,IAA4B,EAAE;gBACvD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;YAC5B,CAAC;WAAC;QAtEA,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,iBAAiB;IACjD,CAAC;IAsED;;;;;;;;;;;;;;OAcG;IACH,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;;;;;;;;;;;;;OAaG,CAAC,MAAM,CAAC,yBAAyB,CAClC,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 /**\n * A function to initialize an object with an inner parameter and derive a signerType from it.\n *\n * @example\n * ```ts\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { privateKeyToAccount, generatePrivateKey } from \"viem\";\n *\n * const signer = new LocalAccountSigner(\n * privateKeyToAccount(generatePrivateKey()),\n * );\n * ```\n *\n * @param {T} inner The inner parameter containing the necessary data\n */\n constructor(inner: T) {\n this.inner = inner;\n this.signerType = inner.type; // type: \"local\"\n }\n\n /**\n * Signs the provided message using the inner signMessage function.\n *\n * @example\n * ```ts\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\";\n *\n * const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());\n * const signature = await signer.signMessage(\"Hello, world!\");\n * ```\n *\n * @param {string} message The message to be signed\n * @returns {Promise<any>} A promise that resolves to the signed message\n */\n readonly signMessage: (message: SignableMessage) => Promise<`0x${string}`> = (\n message\n ) => {\n return this.inner.signMessage({ message });\n };\n\n /**\n * Signs typed data using the given parameters.\n *\n * @example\n * ```ts\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\";\n *\n * const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());\n * const signature = await signer.signTypedData({\n * domain: {},\n * types: {},\n * primaryType: \"\",\n * message: {},\n * });\n * ```\n *\n * @param {TypedDataDefinition<TTypedData, TPrimaryType>} params The parameters defining the typed data and primary type\n * @returns {Promise<Hex>} A promise that resolves to the signed data in hexadecimal format\n */\n readonly signTypedData = async <\n const TTypedData extends TypedData | Record<string, unknown>,\n TPrimaryType extends keyof TTypedData | \"EIP712Domain\" = keyof TTypedData\n >(\n params: TypedDataDefinition<TTypedData, TPrimaryType>\n ): Promise<Hex> => {\n return this.inner.signTypedData(params);\n };\n\n /**\n * Returns the address of the inner object in a specific hexadecimal format.\n *\n * @example\n * ```ts\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\";\n *\n * const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());\n * const address = await signer.getAddress();\n * ```\n *\n * @returns {Promise<Hex>} A promise that resolves to the address in the format `0x{string}`\n */\n readonly getAddress = async (): Promise<`0x${string}`> => {\n return this.inner.address;\n };\n\n /**\n * Creates a LocalAccountSigner using the provided mnemonic key and optional HD options.\n *\n * @example\n * ```ts\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generateMnemonic } from \"viem\";\n *\n * const signer = LocalAccountSigner.mnemonicToAccountSigner(generateMnemonic());\n * ```\n *\n * @param {string} key The mnemonic key to derive the account from.\n * @param {HDOptions} [opts] Optional HD options for deriving the account.\n * @returns {LocalAccountSigner<HDAccount>} A LocalAccountSigner object for the derived account.\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 /**\n * Creates a `LocalAccountSigner` instance using the provided private key.\n *\n * @example\n * ```ts\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\";\n *\n * const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());\n * ```\n *\n * @param {Hex} key The private key in hexadecimal format\n * @returns {LocalAccountSigner<PrivateKeyAccount>} An instance of `LocalAccountSigner` initialized with the provided private key\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,EACL,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAGvB;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAO7B;;;;;;;;;;;;;;OAcG;IACH,YAAY,KAAQ;QAlBpB;;;;;WAAS;QACT;;;;;WAAmB;QAsBnB;;;;;;;;;;;;;;WAcG;QACM;;;;mBAAoE,CAC3E,OAAO,EACP,EAAE;gBACF,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;YAC7C,CAAC;WAAC;QAEF;;;;;;;;;;;;;;;;;;;WAmBG;QACM;;;;mBAAgB,KAAK,EAI5B,MAAqD,EACvC,EAAE;gBAChB,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAC1C,CAAC;WAAC;QAEF;;;;;;;;;;;;;WAaG;QACM;;;;mBAAa,KAAK,IAA4B,EAAE;gBACvD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;YAC5B,CAAC;WAAC;QAtEA,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,iBAAiB;IACjD,CAAC;IAsED;;;;;;;;;;;;;;OAcG;IACH,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;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,yBAAyB,CAC9B,GAAQ;QAER,MAAM,MAAM,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACxC,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,wBAAwB;QAC7B,MAAM,MAAM,GAAG,mBAAmB,CAAC,kBAAkB,EAAE,CAAC,CAAC;QACzD,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 {\n generatePrivateKey,\n mnemonicToAccount,\n privateKeyToAccount,\n} 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 /**\n * A function to initialize an object with an inner parameter and derive a signerType from it.\n *\n * @example\n * ```ts\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { privateKeyToAccount, generatePrivateKey } from \"viem\";\n *\n * const signer = new LocalAccountSigner(\n * privateKeyToAccount(generatePrivateKey()),\n * );\n * ```\n *\n * @param {T} inner The inner parameter containing the necessary data\n */\n constructor(inner: T) {\n this.inner = inner;\n this.signerType = inner.type; // type: \"local\"\n }\n\n /**\n * Signs the provided message using the inner signMessage function.\n *\n * @example\n * ```ts\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\";\n *\n * const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());\n * const signature = await signer.signMessage(\"Hello, world!\");\n * ```\n *\n * @param {string} message The message to be signed\n * @returns {Promise<any>} A promise that resolves to the signed message\n */\n readonly signMessage: (message: SignableMessage) => Promise<`0x${string}`> = (\n message\n ) => {\n return this.inner.signMessage({ message });\n };\n\n /**\n * Signs typed data using the given parameters.\n *\n * @example\n * ```ts\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\";\n *\n * const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());\n * const signature = await signer.signTypedData({\n * domain: {},\n * types: {},\n * primaryType: \"\",\n * message: {},\n * });\n * ```\n *\n * @param {TypedDataDefinition<TTypedData, TPrimaryType>} params The parameters defining the typed data and primary type\n * @returns {Promise<Hex>} A promise that resolves to the signed data in hexadecimal format\n */\n readonly signTypedData = async <\n const TTypedData extends TypedData | Record<string, unknown>,\n TPrimaryType extends keyof TTypedData | \"EIP712Domain\" = keyof TTypedData\n >(\n params: TypedDataDefinition<TTypedData, TPrimaryType>\n ): Promise<Hex> => {\n return this.inner.signTypedData(params);\n };\n\n /**\n * Returns the address of the inner object in a specific hexadecimal format.\n *\n * @example\n * ```ts\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\";\n *\n * const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());\n * const address = await signer.getAddress();\n * ```\n *\n * @returns {Promise<Hex>} A promise that resolves to the address in the format `0x{string}`\n */\n readonly getAddress = async (): Promise<`0x${string}`> => {\n return this.inner.address;\n };\n\n /**\n * Creates a LocalAccountSigner using the provided mnemonic key and optional HD options.\n *\n * @example\n * ```ts\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generateMnemonic } from \"viem\";\n *\n * const signer = LocalAccountSigner.mnemonicToAccountSigner(generateMnemonic());\n * ```\n *\n * @param {string} key The mnemonic key to derive the account from.\n * @param {HDOptions} [opts] Optional HD options for deriving the account.\n * @returns {LocalAccountSigner<HDAccount>} A LocalAccountSigner object for the derived account.\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 /**\n * Creates a `LocalAccountSigner` instance using the provided private key.\n *\n * @example\n * ```ts\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\";\n *\n * const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());\n * ```\n *\n * @param {Hex} key The private key in hexadecimal format\n * @returns {LocalAccountSigner<PrivateKeyAccount>} An instance of `LocalAccountSigner` initialized with the provided private key\n */\n static privateKeyToAccountSigner(\n key: Hex\n ): LocalAccountSigner<PrivateKeyAccount> {\n const signer = privateKeyToAccount(key);\n return new LocalAccountSigner(signer);\n }\n\n /**\n * Generates a new private key and creates a `LocalAccountSigner` for a `PrivateKeyAccount`.\n *\n * @example\n * ```ts\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n *\n * const signer = LocalAccountSigner.generatePrivateKeySigner();\n * ```\n *\n * @returns {LocalAccountSigner<PrivateKeyAccount>} A `LocalAccountSigner` instance initialized with the generated private key account\n */\n static generatePrivateKeySigner(): LocalAccountSigner<PrivateKeyAccount> {\n const signer = privateKeyToAccount(generatePrivateKey());\n return new LocalAccountSigner(signer);\n }\n}\n"]}
@@ -112,36 +112,6 @@ export interface UserOperationReceipt {
112
112
  logs: string[];
113
113
  receipt: TransactionReceipt;
114
114
  }
115
- /** @deprecated use viem type TransactionReceipt instead */
116
- export interface UserOperationReceiptObject {
117
- blockHash: Hash;
118
- blockNumber: BigNumberish;
119
- transactionIndex: BigNumberish;
120
- transactionHash: Hash;
121
- from: Address;
122
- to: Address;
123
- cumulativeGasUsed: BigNumberish;
124
- gasUsed: BigNumberish;
125
- contractAddress: Address;
126
- logs: UserOperationReceiptLog[];
127
- logsBloom: Hex;
128
- root: Hex;
129
- status: number;
130
- effectiveGasPrice: BigNumberish;
131
- type: string;
132
- }
133
- /** @deprecated use viem type Log instead */
134
- export interface UserOperationReceiptLog {
135
- blockHash: Hash;
136
- blockNumber: BigNumberish;
137
- transactionIndex: BigNumberish;
138
- address: Address;
139
- logIndex: BigNumberish;
140
- data: Hex;
141
- removed: boolean;
142
- topics: string[];
143
- transactionHash: Hash;
144
- }
145
115
  export interface UserOperationStruct_v6 {
146
116
  sender: string;
147
117
  nonce: BigNumberish;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,MAAM,MAAM,CAAC;AAoZd,mCAAmC","sourcesContent":["import {\n type Address,\n type Hash,\n type Hex,\n type StateOverride,\n type TransactionReceipt,\n} from \"viem\";\nimport type { z } from \"zod\";\nimport type {\n UserOperationFeeOptionsFieldSchema,\n UserOperationFeeOptionsSchema,\n UserOperationFeeOptionsSchema_v6,\n UserOperationFeeOptionsSchema_v7,\n} from \"./client/schema\";\nimport type { EntryPointVersion } from \"./entrypoint/types\";\nimport type {\n BigNumberishRangeSchema,\n BigNumberishSchema,\n MultiplierSchema,\n NoUndefined,\n} from \"./utils\";\n\nexport type EmptyHex = `0x`;\nexport type NullAddress = `0x0`;\n\n// based on @account-abstraction/common\nexport type PromiseOrValue<T> = T | Promise<T>;\nexport type BytesLike = Uint8Array | Hex;\nexport type Multiplier = z.input<typeof MultiplierSchema>;\n\nexport type BigNumberish = z.input<typeof BigNumberishSchema>;\nexport type BigNumberishRange = z.input<typeof BigNumberishRangeSchema>;\n\n// [!region UserOperationCallData]\nexport type UserOperationCallData =\n | {\n /* the target of the call */\n target: Address;\n /* the data passed to the target */\n data: Hex;\n /* the amount of native token to send to the target (default: 0) */\n value?: bigint;\n }\n | Hex;\n// [!endregion UserOperationCallData]\n\n// [!region BatchUserOperationCallData]\nexport type BatchUserOperationCallData = Exclude<UserOperationCallData, Hex>[];\n// [!endregion BatchUserOperationCallData]\n\nexport type UserOperationFeeOptionsField = z.input<\n typeof UserOperationFeeOptionsFieldSchema\n>;\n\nexport type UserOperationFeeOptions<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = TEntryPointVersion extends \"0.6.0\"\n ? z.input<typeof UserOperationFeeOptionsSchema_v6>\n : TEntryPointVersion extends \"0.7.0\"\n ? z.input<typeof UserOperationFeeOptionsSchema_v7>\n : z.input<typeof UserOperationFeeOptionsSchema>;\n\nexport type UserOperationOverridesParameter<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion,\n Required extends boolean = false\n> = Required extends true\n ? { overrides: UserOperationOverrides<TEntryPointVersion> }\n : { overrides?: UserOperationOverrides<TEntryPointVersion> };\n\n// [!region UserOperationPaymasterOverrides]\nexport type UserOperationPaymasterOverrides<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = TEntryPointVersion extends \"0.6.0\"\n ? {\n // paymasterData overrides to bypass paymaster middleware\n paymasterAndData: Hex;\n }\n : TEntryPointVersion extends \"0.7.0\"\n ? {\n // paymasterData overrides to bypass paymaster middleware\n // if set to '0x', all paymaster related fields are omitted from the user op request\n paymasterData: Hex;\n paymaster: Address;\n paymasterVerificationGasLimit:\n | NoUndefined<\n UserOperationStruct<\"0.7.0\">[\"paymasterVerificationGasLimit\"]\n >\n | Multiplier;\n paymasterPostOpGasLimit:\n | NoUndefined<UserOperationStruct<\"0.7.0\">[\"paymasterPostOpGasLimit\"]>\n | Multiplier;\n }\n : {};\n// [!endregion UserOperationOverridesParameter]\n\n// [!region UserOperationOverrides]\nexport type UserOperationOverrides<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = Partial<\n {\n callGasLimit:\n | UserOperationStruct<TEntryPointVersion>[\"callGasLimit\"]\n | Multiplier;\n maxFeePerGas:\n | UserOperationStruct<TEntryPointVersion>[\"maxFeePerGas\"]\n | Multiplier;\n maxPriorityFeePerGas:\n | UserOperationStruct<TEntryPointVersion>[\"maxPriorityFeePerGas\"]\n | Multiplier;\n preVerificationGas:\n | UserOperationStruct<TEntryPointVersion>[\"preVerificationGas\"]\n | Multiplier;\n verificationGasLimit:\n | UserOperationStruct<TEntryPointVersion>[\"verificationGasLimit\"]\n | Multiplier;\n /**\n * This can be used to override the key used when calling `entryPoint.getNonce`\n * It is useful when you want to use parallel nonces for user operations\n *\n * NOTE: not all bundlers fully support this feature and it could be that your bundler will still only include\n * one user operation for your account in a bundle\n */\n nonceKey: bigint;\n\n /**\n * The same state overrides for\n * [`eth_call`](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-eth#eth-call) method.\n * An address-to-state mapping, where each entry specifies some state to be ephemerally overridden\n * prior to executing the call. State overrides allow you to customize the network state for\n * the purpose of the simulation, so this feature is useful when you need to estimate gas\n * for user operation scenarios under conditions that aren’t currently present on the live network.\n */\n stateOverride: StateOverride;\n } & UserOperationPaymasterOverrides<TEntryPointVersion>\n>;\n// [!endregion UserOperationOverrides]\n\n// [!region UserOperationRequest_v6]\n// represents the request as it needs to be formatted for v0.6 RPC requests\n// Reference: https://github.com/ethereum/ERCs/blob/8dd085d159cb123f545c272c0d871a5339550e79/ERCS/erc-4337.md#definitions\nexport interface UserOperationRequest_v6 {\n /* the origin of the request */\n sender: Address;\n /* nonce (as hex) of the transaction, returned from the entry point for this Address */\n nonce: Hex;\n /* the initCode for creating the sender if it does not exist yet, otherwise \"0x\" */\n initCode: Hex | EmptyHex;\n /* the callData passed to the target */\n callData: Hex;\n /* Gas value (as hex) used by inner account execution */\n callGasLimit: Hex;\n /* Actual gas (as hex) used by the validation of this UserOperation */\n verificationGasLimit: Hex;\n /* Gas overhead (as hex) of this UserOperation */\n preVerificationGas: Hex;\n /* Maximum fee per gas (similar to EIP-1559 max_fee_per_gas) (as hex)*/\n maxFeePerGas: Hex;\n /* Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) (as hex)*/\n maxPriorityFeePerGas: Hex;\n /* Address of paymaster sponsoring the transaction, followed by extra data to send to the paymaster (\"0x\" for self-sponsored transaction) */\n paymasterAndData: Hex | EmptyHex;\n /* Data passed into the account along with the nonce during the verification step */\n signature: Hex;\n}\n// [!endregion UserOperationRequest_v6]\n\n// [!region UserOperationRequest_v7]\n// represents the request as it needs to be formatted for v0.7 RPC requests\n// Reference: https://eips.ethereum.org/EIPS/eip-4337#definitions\nexport interface UserOperationRequest_v7 {\n /* the account making the operation */\n sender: Address;\n /* anti-replay parameter. nonce of the transaction, returned from the entry point for this address */\n nonce: Hex;\n /* account factory, only for new accounts */\n factory?: Address;\n /* data for account factory (only if account factory exists) */\n factoryData?: Hex;\n /* the data to pass to the sender during the main execution call */\n callData: Hex;\n /* the amount of gas to allocate the main execution call */\n callGasLimit: Hex;\n /* the amount of gas to allocate for the verification step */\n verificationGasLimit: Hex;\n /* extra gas to pay the bunder */\n preVerificationGas: Hex;\n /* maximum fee per gas (similar to EIP-1559 max_fee_per_gas) */\n maxFeePerGas: Hex;\n /* maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) */\n maxPriorityFeePerGas: Hex;\n /* address of paymaster contract, (or empty, if account pays for itself) */\n paymaster?: Address;\n /* the amount of gas to allocate for the paymaster validation code */\n paymasterVerificationGasLimit?: Hex;\n /* the amount of gas to allocate for the paymaster post-operation code */\n paymasterPostOpGasLimit?: Hex;\n /* data for paymaster (only if paymaster exists) */\n paymasterData?: Hex;\n /* data passed into the account to verify authorization */\n signature: Hex;\n}\n// [!endregion UserOperationRequest_v7]\n\n// [!region UserOperationRequest]\n// Reference: https://eips.ethereum.org/EIPS/eip-4337#definitions\nexport type UserOperationRequest<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = TEntryPointVersion extends \"0.6.0\"\n ? UserOperationRequest_v6\n : TEntryPointVersion extends \"0.7.0\"\n ? UserOperationRequest_v7\n : never;\n\n// [!endregion UserOperationRequest]\n\n// [!region UserOperationEstimateGasResponse]\nexport interface UserOperationEstimateGasResponse<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> {\n /* Gas overhead of this UserOperation */\n preVerificationGas: BigNumberish;\n /* Actual gas used by the validation of this UserOperation */\n verificationGasLimit: BigNumberish;\n /* Value used by inner account execution */\n callGasLimit: BigNumberish;\n /*\n * EntryPoint v0.7.0 operations only.\n * The amount of gas to allocate for the paymaster validation code.\n * Note: `eth_estimateUserOperationGas` does not return paymasterPostOpGasLimit.\n */\n paymasterVerificationGasLimit: TEntryPointVersion extends \"0.7.0\"\n ? BigNumberish | undefined\n : never;\n}\n// [!endregion UserOperationEstimateGasResponse]\n\n// [!region UserOperationResponse]\nexport interface UserOperationResponse<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> {\n /* the User Operation */\n userOperation: UserOperationRequest<TEntryPointVersion>;\n /* the address of the entry point contract that executed the user operation */\n entryPoint: Address;\n /* the block number the user operation was included in */\n blockNumber: BigNumberish;\n /* the hash of the block the user operation was included in */\n blockHash: Hash;\n /* the hash of the transaction that included the user operation */\n transactionHash: Hash;\n}\n// [!endregion UserOperationResponse]\n\n// [!region UserOperationReceipt]\nexport interface UserOperationReceipt {\n /* The request hash of the UserOperation. */\n userOpHash: Hash;\n /* The entry point address used for the UserOperation. */\n entryPoint: Address;\n /* The account initiating the UserOperation. */\n sender: Address;\n /* The nonce used in the UserOperation. */\n nonce: BigNumberish;\n /* The paymaster used for this UserOperation (or empty). */\n paymaster?: Address;\n /* The actual amount paid (by account or paymaster) for this UserOperation. */\n actualGasCost: BigNumberish;\n /* The total gas used by this UserOperation (including preVerification, creation, validation, and execution). */\n actualGasUsed: BigNumberish;\n /* Indicates whether the execution completed without reverting. */\n success: boolean;\n /* In case of revert, this is the revert reason. */\n reason?: string;\n /* The logs generated by this UserOperation (not including logs of other UserOperations in the same bundle). */\n logs: string[];\n /* The TransactionReceipt object for the entire bundle, not only for this UserOperation. */\n receipt: TransactionReceipt;\n}\n// [!endregion UserOperationReceipt]\n\n/** @deprecated use viem type TransactionReceipt instead */\nexport interface UserOperationReceiptObject {\n /* 32 Bytes - hash of the block where this log was in. null when its pending. null when its pending log */\n blockHash: Hash;\n /* The block number where this log was in. null when its pending. null when its pending log. */\n blockNumber: BigNumberish;\n /* The index of the transaction within the block. */\n transactionIndex: BigNumberish;\n /* 32 Bytes - hash of the transaction. null when its pending. */\n transactionHash: Hash;\n /* 20 Bytes - address of the sender */\n from: Address;\n /* 20 Bytes - address of the receiver. null when its a contract creation transaction */\n to: Address;\n /* The total amount of gas used when this transaction was executed in the block. */\n cumulativeGasUsed: BigNumberish;\n /* The amount of gas used by this specific transaction alone */\n gasUsed: BigNumberish;\n /* 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null */\n contractAddress: Address;\n logs: UserOperationReceiptLog[];\n /* 256 Bytes - Bloom filter for light clients to quickly retrieve related logs */\n logsBloom: Hex;\n /* 32 bytes of post-transaction stateroot. (pre Byzantium hard fork at block 4,370,000) */\n root: Hex;\n /* Either 1 (success) or 0 (failure). (post Byzantium hard fork at block 4,370,000) */\n status: number;\n /* The cumulative gas used in the block containing this UserOperation. */\n effectiveGasPrice: BigNumberish;\n /* The type of the recipt object */\n type: string;\n}\n\n/** @deprecated use viem type Log instead */\n/* https://github.com/wevm/viem/blob/6ef4ac131a878bf1dc4b335f5dc127e62618dda0/src/types/log.ts#L15 */\nexport interface UserOperationReceiptLog {\n /* The hash of the block where the given transaction was included. */\n blockHash: Hash;\n /* The number of the block where the given transaction was included. */\n blockNumber: BigNumberish;\n /* The index of the transaction within the block. */\n transactionIndex: BigNumberish;\n /* 20 Bytes - address from which this log originated. */\n address: Address;\n /* Integer of the log index position in the block. null when its pending log. */\n logIndex: BigNumberish;\n /* Contains one or more 32 Bytes non-indexed arguments of the log. */\n data: Hex;\n /* true when the log was removed, due to a chain reorganization. false if its a valid log. */\n removed: boolean;\n /* Array of zero to four 32 Bytes DATA of indexed log arguments. */\n topics: string[];\n /* hash of the transaction */\n transactionHash: Hash;\n}\n\n// [!region UserOperationStruct_v6]\n// https://github.com/eth-infinitism/account-abstraction/blob/releases/v0.6/test/UserOperation.ts\n// this is used for building requests for v0.6 entry point contract\nexport interface UserOperationStruct_v6 {\n /* the origin of the request */\n sender: string;\n /* nonce of the transaction, returned from the entry point for this address */\n nonce: BigNumberish;\n /* the initCode for creating the sender if it does not exist yet, otherwise \"0x\" */\n initCode: BytesLike | \"0x\";\n /* the callData passed to the target */\n callData: BytesLike;\n /* Value used by inner account execution */\n callGasLimit?: BigNumberish;\n /* Actual gas used by the validation of this UserOperation */\n verificationGasLimit?: BigNumberish;\n /* Gas overhead of this UserOperation */\n preVerificationGas?: BigNumberish;\n /* Maximum fee per gas (similar to EIP-1559 max_fee_per_gas) */\n maxFeePerGas?: BigNumberish;\n /* Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) */\n maxPriorityFeePerGas?: BigNumberish;\n /* Address of paymaster sponsoring the transaction, followed by extra data to send to the paymaster (\"0x\" for self-sponsored transaction) */\n paymasterAndData: BytesLike | \"0x\";\n /* Data passed into the account along with the nonce during the verification step */\n signature: BytesLike;\n}\n// [!endregion UserOperationStruct_v6]\n\n// [!region UserOperationStruct_v7]\n// based on https://github.com/eth-infinitism/account-abstraction/blob/releases/v0.7/test/UserOperation.ts\n// this is used for building requests for v0.7 entry point contract\nexport interface UserOperationStruct_v7 {\n /* the account making the operation */\n sender: string;\n /* anti-replay parameter. nonce of the transaction, returned from the entry point for this address */\n nonce: BigNumberish;\n /* account factory, only for new accounts */\n factory?: string;\n /* data for account factory (only if account factory exists) */\n factoryData?: BytesLike;\n /* the data to pass to the sender during the main execution call */\n callData: BytesLike;\n /* the amount of gas to allocate the main execution call */\n callGasLimit?: BigNumberish;\n /* the amount of gas to allocate for the verification step */\n verificationGasLimit?: BigNumberish;\n /* extra gas to pay the bunder */\n preVerificationGas?: BigNumberish;\n /* maximum fee per gas (similar to EIP-1559 max_fee_per_gas) */\n maxFeePerGas?: BigNumberish;\n /* maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) */\n maxPriorityFeePerGas?: BigNumberish;\n /* address of paymaster contract, (or empty, if account pays for itself) */\n paymaster?: string;\n /* the amount of gas to allocate for the paymaster validation code */\n paymasterVerificationGasLimit?: BigNumberish;\n /* the amount of gas to allocate for the paymaster post-operation code */\n paymasterPostOpGasLimit?: BigNumberish;\n /* data for paymaster (only if paymaster exists) */\n paymasterData?: BytesLike;\n /* data passed into the account to verify authorization */\n signature: BytesLike;\n}\n// [!endregion UserOperationStruct_v7]\n\n// [!region UserOperationStruct]\nexport type UserOperationStruct<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = TEntryPointVersion extends \"0.6.0\"\n ? UserOperationStruct_v6\n : TEntryPointVersion extends \"0.7.0\"\n ? UserOperationStruct_v7\n : never;\n// [!endregion UserOperationStruct]\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,MAAM,MAAM,CAAC;AA4Vd,mCAAmC","sourcesContent":["import {\n type Address,\n type Hash,\n type Hex,\n type StateOverride,\n type TransactionReceipt,\n} from \"viem\";\nimport type { z } from \"zod\";\nimport type {\n UserOperationFeeOptionsFieldSchema,\n UserOperationFeeOptionsSchema,\n UserOperationFeeOptionsSchema_v6,\n UserOperationFeeOptionsSchema_v7,\n} from \"./client/schema\";\nimport type { EntryPointVersion } from \"./entrypoint/types\";\nimport type {\n BigNumberishRangeSchema,\n BigNumberishSchema,\n MultiplierSchema,\n NoUndefined,\n} from \"./utils\";\n\nexport type EmptyHex = `0x`;\nexport type NullAddress = `0x0`;\n\n// based on @account-abstraction/common\nexport type PromiseOrValue<T> = T | Promise<T>;\nexport type BytesLike = Uint8Array | Hex;\nexport type Multiplier = z.input<typeof MultiplierSchema>;\n\nexport type BigNumberish = z.input<typeof BigNumberishSchema>;\nexport type BigNumberishRange = z.input<typeof BigNumberishRangeSchema>;\n\n// [!region UserOperationCallData]\nexport type UserOperationCallData =\n | {\n /* the target of the call */\n target: Address;\n /* the data passed to the target */\n data: Hex;\n /* the amount of native token to send to the target (default: 0) */\n value?: bigint;\n }\n | Hex;\n// [!endregion UserOperationCallData]\n\n// [!region BatchUserOperationCallData]\nexport type BatchUserOperationCallData = Exclude<UserOperationCallData, Hex>[];\n// [!endregion BatchUserOperationCallData]\n\nexport type UserOperationFeeOptionsField = z.input<\n typeof UserOperationFeeOptionsFieldSchema\n>;\n\nexport type UserOperationFeeOptions<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = TEntryPointVersion extends \"0.6.0\"\n ? z.input<typeof UserOperationFeeOptionsSchema_v6>\n : TEntryPointVersion extends \"0.7.0\"\n ? z.input<typeof UserOperationFeeOptionsSchema_v7>\n : z.input<typeof UserOperationFeeOptionsSchema>;\n\nexport type UserOperationOverridesParameter<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion,\n Required extends boolean = false\n> = Required extends true\n ? { overrides: UserOperationOverrides<TEntryPointVersion> }\n : { overrides?: UserOperationOverrides<TEntryPointVersion> };\n\n// [!region UserOperationPaymasterOverrides]\nexport type UserOperationPaymasterOverrides<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = TEntryPointVersion extends \"0.6.0\"\n ? {\n // paymasterData overrides to bypass paymaster middleware\n paymasterAndData: Hex;\n }\n : TEntryPointVersion extends \"0.7.0\"\n ? {\n // paymasterData overrides to bypass paymaster middleware\n // if set to '0x', all paymaster related fields are omitted from the user op request\n paymasterData: Hex;\n paymaster: Address;\n paymasterVerificationGasLimit:\n | NoUndefined<\n UserOperationStruct<\"0.7.0\">[\"paymasterVerificationGasLimit\"]\n >\n | Multiplier;\n paymasterPostOpGasLimit:\n | NoUndefined<UserOperationStruct<\"0.7.0\">[\"paymasterPostOpGasLimit\"]>\n | Multiplier;\n }\n : {};\n// [!endregion UserOperationOverridesParameter]\n\n// [!region UserOperationOverrides]\nexport type UserOperationOverrides<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = Partial<\n {\n callGasLimit:\n | UserOperationStruct<TEntryPointVersion>[\"callGasLimit\"]\n | Multiplier;\n maxFeePerGas:\n | UserOperationStruct<TEntryPointVersion>[\"maxFeePerGas\"]\n | Multiplier;\n maxPriorityFeePerGas:\n | UserOperationStruct<TEntryPointVersion>[\"maxPriorityFeePerGas\"]\n | Multiplier;\n preVerificationGas:\n | UserOperationStruct<TEntryPointVersion>[\"preVerificationGas\"]\n | Multiplier;\n verificationGasLimit:\n | UserOperationStruct<TEntryPointVersion>[\"verificationGasLimit\"]\n | Multiplier;\n /**\n * This can be used to override the key used when calling `entryPoint.getNonce`\n * It is useful when you want to use parallel nonces for user operations\n *\n * NOTE: not all bundlers fully support this feature and it could be that your bundler will still only include\n * one user operation for your account in a bundle\n */\n nonceKey: bigint;\n\n /**\n * The same state overrides for\n * [`eth_call`](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-eth#eth-call) method.\n * An address-to-state mapping, where each entry specifies some state to be ephemerally overridden\n * prior to executing the call. State overrides allow you to customize the network state for\n * the purpose of the simulation, so this feature is useful when you need to estimate gas\n * for user operation scenarios under conditions that aren’t currently present on the live network.\n */\n stateOverride: StateOverride;\n } & UserOperationPaymasterOverrides<TEntryPointVersion>\n>;\n// [!endregion UserOperationOverrides]\n\n// [!region UserOperationRequest_v6]\n// represents the request as it needs to be formatted for v0.6 RPC requests\n// Reference: https://github.com/ethereum/ERCs/blob/8dd085d159cb123f545c272c0d871a5339550e79/ERCS/erc-4337.md#definitions\nexport interface UserOperationRequest_v6 {\n /* the origin of the request */\n sender: Address;\n /* nonce (as hex) of the transaction, returned from the entry point for this Address */\n nonce: Hex;\n /* the initCode for creating the sender if it does not exist yet, otherwise \"0x\" */\n initCode: Hex | EmptyHex;\n /* the callData passed to the target */\n callData: Hex;\n /* Gas value (as hex) used by inner account execution */\n callGasLimit: Hex;\n /* Actual gas (as hex) used by the validation of this UserOperation */\n verificationGasLimit: Hex;\n /* Gas overhead (as hex) of this UserOperation */\n preVerificationGas: Hex;\n /* Maximum fee per gas (similar to EIP-1559 max_fee_per_gas) (as hex)*/\n maxFeePerGas: Hex;\n /* Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) (as hex)*/\n maxPriorityFeePerGas: Hex;\n /* Address of paymaster sponsoring the transaction, followed by extra data to send to the paymaster (\"0x\" for self-sponsored transaction) */\n paymasterAndData: Hex | EmptyHex;\n /* Data passed into the account along with the nonce during the verification step */\n signature: Hex;\n}\n// [!endregion UserOperationRequest_v6]\n\n// [!region UserOperationRequest_v7]\n// represents the request as it needs to be formatted for v0.7 RPC requests\n// Reference: https://eips.ethereum.org/EIPS/eip-4337#definitions\nexport interface UserOperationRequest_v7 {\n /* the account making the operation */\n sender: Address;\n /* anti-replay parameter. nonce of the transaction, returned from the entry point for this address */\n nonce: Hex;\n /* account factory, only for new accounts */\n factory?: Address;\n /* data for account factory (only if account factory exists) */\n factoryData?: Hex;\n /* the data to pass to the sender during the main execution call */\n callData: Hex;\n /* the amount of gas to allocate the main execution call */\n callGasLimit: Hex;\n /* the amount of gas to allocate for the verification step */\n verificationGasLimit: Hex;\n /* extra gas to pay the bunder */\n preVerificationGas: Hex;\n /* maximum fee per gas (similar to EIP-1559 max_fee_per_gas) */\n maxFeePerGas: Hex;\n /* maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) */\n maxPriorityFeePerGas: Hex;\n /* address of paymaster contract, (or empty, if account pays for itself) */\n paymaster?: Address;\n /* the amount of gas to allocate for the paymaster validation code */\n paymasterVerificationGasLimit?: Hex;\n /* the amount of gas to allocate for the paymaster post-operation code */\n paymasterPostOpGasLimit?: Hex;\n /* data for paymaster (only if paymaster exists) */\n paymasterData?: Hex;\n /* data passed into the account to verify authorization */\n signature: Hex;\n}\n// [!endregion UserOperationRequest_v7]\n\n// [!region UserOperationRequest]\n// Reference: https://eips.ethereum.org/EIPS/eip-4337#definitions\nexport type UserOperationRequest<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = TEntryPointVersion extends \"0.6.0\"\n ? UserOperationRequest_v6\n : TEntryPointVersion extends \"0.7.0\"\n ? UserOperationRequest_v7\n : never;\n\n// [!endregion UserOperationRequest]\n\n// [!region UserOperationEstimateGasResponse]\nexport interface UserOperationEstimateGasResponse<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> {\n /* Gas overhead of this UserOperation */\n preVerificationGas: BigNumberish;\n /* Actual gas used by the validation of this UserOperation */\n verificationGasLimit: BigNumberish;\n /* Value used by inner account execution */\n callGasLimit: BigNumberish;\n /*\n * EntryPoint v0.7.0 operations only.\n * The amount of gas to allocate for the paymaster validation code.\n * Note: `eth_estimateUserOperationGas` does not return paymasterPostOpGasLimit.\n */\n paymasterVerificationGasLimit: TEntryPointVersion extends \"0.7.0\"\n ? BigNumberish | undefined\n : never;\n}\n// [!endregion UserOperationEstimateGasResponse]\n\n// [!region UserOperationResponse]\nexport interface UserOperationResponse<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> {\n /* the User Operation */\n userOperation: UserOperationRequest<TEntryPointVersion>;\n /* the address of the entry point contract that executed the user operation */\n entryPoint: Address;\n /* the block number the user operation was included in */\n blockNumber: BigNumberish;\n /* the hash of the block the user operation was included in */\n blockHash: Hash;\n /* the hash of the transaction that included the user operation */\n transactionHash: Hash;\n}\n// [!endregion UserOperationResponse]\n\n// [!region UserOperationReceipt]\nexport interface UserOperationReceipt {\n /* The request hash of the UserOperation. */\n userOpHash: Hash;\n /* The entry point address used for the UserOperation. */\n entryPoint: Address;\n /* The account initiating the UserOperation. */\n sender: Address;\n /* The nonce used in the UserOperation. */\n nonce: BigNumberish;\n /* The paymaster used for this UserOperation (or empty). */\n paymaster?: Address;\n /* The actual amount paid (by account or paymaster) for this UserOperation. */\n actualGasCost: BigNumberish;\n /* The total gas used by this UserOperation (including preVerification, creation, validation, and execution). */\n actualGasUsed: BigNumberish;\n /* Indicates whether the execution completed without reverting. */\n success: boolean;\n /* In case of revert, this is the revert reason. */\n reason?: string;\n /* The logs generated by this UserOperation (not including logs of other UserOperations in the same bundle). */\n logs: string[];\n /* The TransactionReceipt object for the entire bundle, not only for this UserOperation. */\n receipt: TransactionReceipt;\n}\n// [!endregion UserOperationReceipt]\n\n// [!region UserOperationStruct_v6]\n// https://github.com/eth-infinitism/account-abstraction/blob/releases/v0.6/test/UserOperation.ts\n// this is used for building requests for v0.6 entry point contract\nexport interface UserOperationStruct_v6 {\n /* the origin of the request */\n sender: string;\n /* nonce of the transaction, returned from the entry point for this address */\n nonce: BigNumberish;\n /* the initCode for creating the sender if it does not exist yet, otherwise \"0x\" */\n initCode: BytesLike | \"0x\";\n /* the callData passed to the target */\n callData: BytesLike;\n /* Value used by inner account execution */\n callGasLimit?: BigNumberish;\n /* Actual gas used by the validation of this UserOperation */\n verificationGasLimit?: BigNumberish;\n /* Gas overhead of this UserOperation */\n preVerificationGas?: BigNumberish;\n /* Maximum fee per gas (similar to EIP-1559 max_fee_per_gas) */\n maxFeePerGas?: BigNumberish;\n /* Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) */\n maxPriorityFeePerGas?: BigNumberish;\n /* Address of paymaster sponsoring the transaction, followed by extra data to send to the paymaster (\"0x\" for self-sponsored transaction) */\n paymasterAndData: BytesLike | \"0x\";\n /* Data passed into the account along with the nonce during the verification step */\n signature: BytesLike;\n}\n// [!endregion UserOperationStruct_v6]\n\n// [!region UserOperationStruct_v7]\n// based on https://github.com/eth-infinitism/account-abstraction/blob/releases/v0.7/test/UserOperation.ts\n// this is used for building requests for v0.7 entry point contract\nexport interface UserOperationStruct_v7 {\n /* the account making the operation */\n sender: string;\n /* anti-replay parameter. nonce of the transaction, returned from the entry point for this address */\n nonce: BigNumberish;\n /* account factory, only for new accounts */\n factory?: string;\n /* data for account factory (only if account factory exists) */\n factoryData?: BytesLike;\n /* the data to pass to the sender during the main execution call */\n callData: BytesLike;\n /* the amount of gas to allocate the main execution call */\n callGasLimit?: BigNumberish;\n /* the amount of gas to allocate for the verification step */\n verificationGasLimit?: BigNumberish;\n /* extra gas to pay the bunder */\n preVerificationGas?: BigNumberish;\n /* maximum fee per gas (similar to EIP-1559 max_fee_per_gas) */\n maxFeePerGas?: BigNumberish;\n /* maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) */\n maxPriorityFeePerGas?: BigNumberish;\n /* address of paymaster contract, (or empty, if account pays for itself) */\n paymaster?: string;\n /* the amount of gas to allocate for the paymaster validation code */\n paymasterVerificationGasLimit?: BigNumberish;\n /* the amount of gas to allocate for the paymaster post-operation code */\n paymasterPostOpGasLimit?: BigNumberish;\n /* data for paymaster (only if paymaster exists) */\n paymasterData?: BytesLike;\n /* data passed into the account to verify authorization */\n signature: BytesLike;\n}\n// [!endregion UserOperationStruct_v7]\n\n// [!region UserOperationStruct]\nexport type UserOperationStruct<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = TEntryPointVersion extends \"0.6.0\"\n ? UserOperationStruct_v6\n : TEntryPointVersion extends \"0.7.0\"\n ? UserOperationStruct_v7\n : never;\n// [!endregion UserOperationStruct]\n"]}
@@ -1 +1 @@
1
- export declare const VERSION = "4.0.0-beta.1";
1
+ export declare const VERSION = "4.0.0-beta.2";
@@ -1,4 +1,4 @@
1
1
  // This file is autogenerated by inject-version.ts. Any changes will be
2
2
  // overwritten on commit!
3
- export const VERSION = "4.0.0-beta.1";
3
+ export const VERSION = "4.0.0-beta.2";
4
4
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,yBAAyB;AACzB,MAAM,CAAC,MAAM,OAAO,GAAG,cAAc,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"4.0.0-beta.1\";\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,yBAAyB;AACzB,MAAM,CAAC,MAAM,OAAO,GAAG,cAAc,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"4.0.0-beta.2\";\n"]}
@@ -308,6 +308,20 @@ export declare class LocalAccountSigner<T extends HDAccount | PrivateKeyAccount
308
308
  *
309
309
  * @param {Hex} key The private key in hexadecimal format
310
310
  * @returns {LocalAccountSigner<PrivateKeyAccount>} An instance of `LocalAccountSigner` initialized with the provided private key
311
- */ static privateKeyToAccountSigner(key: Hex): LocalAccountSigner<PrivateKeyAccount>;
311
+ */
312
+ static privateKeyToAccountSigner(key: Hex): LocalAccountSigner<PrivateKeyAccount>;
313
+ /**
314
+ * Generates a new private key and creates a `LocalAccountSigner` for a `PrivateKeyAccount`.
315
+ *
316
+ * @example
317
+ * ```ts
318
+ * import { LocalAccountSigner } from "@aa-sdk/core";
319
+ *
320
+ * const signer = LocalAccountSigner.generatePrivateKeySigner();
321
+ * ```
322
+ *
323
+ * @returns {LocalAccountSigner<PrivateKeyAccount>} A `LocalAccountSigner` instance initialized with the generated private key account
324
+ */
325
+ static generatePrivateKeySigner(): LocalAccountSigner<PrivateKeyAccount>;
312
326
  }
313
327
  //# sourceMappingURL=local-account.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"local-account.d.ts","sourceRoot":"","sources":["../../../src/signer/local-account.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,GAAG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;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,yBAAyB,CAC9B,GAAG,EAAE,GAAG,GACP,kBAAkB,CAAC,iBAAiB,CAAC;IAKxC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,wBAAwB,IAAI,kBAAkB,CAAC,iBAAiB,CAAC;CAIzE"}
@@ -112,36 +112,6 @@ export interface UserOperationReceipt {
112
112
  logs: string[];
113
113
  receipt: TransactionReceipt;
114
114
  }
115
- /** @deprecated use viem type TransactionReceipt instead */
116
- export interface UserOperationReceiptObject {
117
- blockHash: Hash;
118
- blockNumber: BigNumberish;
119
- transactionIndex: BigNumberish;
120
- transactionHash: Hash;
121
- from: Address;
122
- to: Address;
123
- cumulativeGasUsed: BigNumberish;
124
- gasUsed: BigNumberish;
125
- contractAddress: Address;
126
- logs: UserOperationReceiptLog[];
127
- logsBloom: Hex;
128
- root: Hex;
129
- status: number;
130
- effectiveGasPrice: BigNumberish;
131
- type: string;
132
- }
133
- /** @deprecated use viem type Log instead */
134
- export interface UserOperationReceiptLog {
135
- blockHash: Hash;
136
- blockNumber: BigNumberish;
137
- transactionIndex: BigNumberish;
138
- address: Address;
139
- logIndex: BigNumberish;
140
- data: Hex;
141
- removed: boolean;
142
- topics: string[];
143
- transactionHash: Hash;
144
- }
145
115
  export interface UserOperationStruct_v6 {
146
116
  sender: string;
147
117
  nonce: BigNumberish;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,IAAI,EACT,KAAK,GAAG,EACR,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EACV,kCAAkC,EAClC,6BAA6B,EAC7B,gCAAgC,EAChC,gCAAgC,EACjC,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK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AExB,QAAQ,EAAE,SAAS,CAAC;IAEpB,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B,oBAAoB,CAAC,EAAE,YAAY,CAAC;IAEpC,kBAAkB,CAAC,EAAE,YAAY,CAAC;IAElC,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B,oBAAoB,CAAC,EAAE,YAAY,CAAC;IAEpC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,6BAA6B,CAAC,EAAE,YAAY,CAAC;IAE7C,uBAAuB,CAAC,EAAE,YAAY,CAAC;IAEvC,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B,SAAS,EAAE,SAAS,CAAC;CACtB;AAID,MAAM,MAAM,mBAAmB,CAC7B,kBAAkB,SAAS,iBAAiB,GAAG,iBAAiB,IAC9D,kBAAkB,SAAS,OAAO,GAClC,sBAAsB,GACtB,kBAAkB,SAAS,OAAO,GAClC,sBAAsB,GACtB,KAAK,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "4.0.0-beta.1";
1
+ export declare const VERSION = "4.0.0-beta.2";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aa-sdk/core",
3
3
  "license": "MIT",
4
- "version": "4.0.0-beta.1",
4
+ "version": "4.0.0-beta.2",
5
5
  "description": "viem based SDK that enables interactions with ERC-4337 Smart Accounts. ABIs are based off the definitions generated in @account-abstraction/contracts",
6
6
  "author": "Alchemy",
7
7
  "type": "module",
@@ -65,5 +65,5 @@
65
65
  "url": "https://github.com/alchemyplatform/aa-sdk/issues"
66
66
  },
67
67
  "homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
68
- "gitHead": "5e0db61aaa6b55e7da3e04d00822392b946b3882"
68
+ "gitHead": "c814690e2cac5d6b4a385730b87a2fcd369377ec"
69
69
  }
@@ -8,7 +8,11 @@ import {
8
8
  type TypedData,
9
9
  type TypedDataDefinition,
10
10
  } from "viem";
11
- import { mnemonicToAccount, privateKeyToAccount } from "viem/accounts";
11
+ import {
12
+ generatePrivateKey,
13
+ mnemonicToAccount,
14
+ privateKeyToAccount,
15
+ } from "viem/accounts";
12
16
  import type { SmartAccountSigner } from "./types.js";
13
17
 
14
18
  /**
@@ -145,10 +149,28 @@ export class LocalAccountSigner<
145
149
  *
146
150
  * @param {Hex} key The private key in hexadecimal format
147
151
  * @returns {LocalAccountSigner<PrivateKeyAccount>} An instance of `LocalAccountSigner` initialized with the provided private key
148
- */ static privateKeyToAccountSigner(
152
+ */
153
+ static privateKeyToAccountSigner(
149
154
  key: Hex
150
155
  ): LocalAccountSigner<PrivateKeyAccount> {
151
156
  const signer = privateKeyToAccount(key);
152
157
  return new LocalAccountSigner(signer);
153
158
  }
159
+
160
+ /**
161
+ * Generates a new private key and creates a `LocalAccountSigner` for a `PrivateKeyAccount`.
162
+ *
163
+ * @example
164
+ * ```ts
165
+ * import { LocalAccountSigner } from "@aa-sdk/core";
166
+ *
167
+ * const signer = LocalAccountSigner.generatePrivateKeySigner();
168
+ * ```
169
+ *
170
+ * @returns {LocalAccountSigner<PrivateKeyAccount>} A `LocalAccountSigner` instance initialized with the generated private key account
171
+ */
172
+ static generatePrivateKeySigner(): LocalAccountSigner<PrivateKeyAccount> {
173
+ const signer = privateKeyToAccount(generatePrivateKey());
174
+ return new LocalAccountSigner(signer);
175
+ }
154
176
  }
package/src/types.ts CHANGED
@@ -278,62 +278,6 @@ export interface UserOperationReceipt {
278
278
  }
279
279
  // [!endregion UserOperationReceipt]
280
280
 
281
- /** @deprecated use viem type TransactionReceipt instead */
282
- export interface UserOperationReceiptObject {
283
- /* 32 Bytes - hash of the block where this log was in. null when its pending. null when its pending log */
284
- blockHash: Hash;
285
- /* The block number where this log was in. null when its pending. null when its pending log. */
286
- blockNumber: BigNumberish;
287
- /* The index of the transaction within the block. */
288
- transactionIndex: BigNumberish;
289
- /* 32 Bytes - hash of the transaction. null when its pending. */
290
- transactionHash: Hash;
291
- /* 20 Bytes - address of the sender */
292
- from: Address;
293
- /* 20 Bytes - address of the receiver. null when its a contract creation transaction */
294
- to: Address;
295
- /* The total amount of gas used when this transaction was executed in the block. */
296
- cumulativeGasUsed: BigNumberish;
297
- /* The amount of gas used by this specific transaction alone */
298
- gasUsed: BigNumberish;
299
- /* 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null */
300
- contractAddress: Address;
301
- logs: UserOperationReceiptLog[];
302
- /* 256 Bytes - Bloom filter for light clients to quickly retrieve related logs */
303
- logsBloom: Hex;
304
- /* 32 bytes of post-transaction stateroot. (pre Byzantium hard fork at block 4,370,000) */
305
- root: Hex;
306
- /* Either 1 (success) or 0 (failure). (post Byzantium hard fork at block 4,370,000) */
307
- status: number;
308
- /* The cumulative gas used in the block containing this UserOperation. */
309
- effectiveGasPrice: BigNumberish;
310
- /* The type of the recipt object */
311
- type: string;
312
- }
313
-
314
- /** @deprecated use viem type Log instead */
315
- /* https://github.com/wevm/viem/blob/6ef4ac131a878bf1dc4b335f5dc127e62618dda0/src/types/log.ts#L15 */
316
- export interface UserOperationReceiptLog {
317
- /* The hash of the block where the given transaction was included. */
318
- blockHash: Hash;
319
- /* The number of the block where the given transaction was included. */
320
- blockNumber: BigNumberish;
321
- /* The index of the transaction within the block. */
322
- transactionIndex: BigNumberish;
323
- /* 20 Bytes - address from which this log originated. */
324
- address: Address;
325
- /* Integer of the log index position in the block. null when its pending log. */
326
- logIndex: BigNumberish;
327
- /* Contains one or more 32 Bytes non-indexed arguments of the log. */
328
- data: Hex;
329
- /* true when the log was removed, due to a chain reorganization. false if its a valid log. */
330
- removed: boolean;
331
- /* Array of zero to four 32 Bytes DATA of indexed log arguments. */
332
- topics: string[];
333
- /* hash of the transaction */
334
- transactionHash: Hash;
335
- }
336
-
337
281
  // [!region UserOperationStruct_v6]
338
282
  // https://github.com/eth-infinitism/account-abstraction/blob/releases/v0.6/test/UserOperation.ts
339
283
  // this is used for building requests for v0.6 entry point contract
package/src/version.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  // This file is autogenerated by inject-version.ts. Any changes will be
2
2
  // overwritten on commit!
3
- export const VERSION = "4.0.0-beta.1";
3
+ export const VERSION = "4.0.0-beta.2";