@aa-sdk/ethers 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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-signer.js","sourceRoot":"","sources":["../../src/account-signer.ts"],"names":[],"mappings":";;;AAAA,uCASsB;AACtB,oEAAwD;AACxD,gDAA+C;AAM/C,+BAAsD;AAGtD,MAAM,eAAe,GAAG,CAAC,KAAU,EAA6B,EAAE;IAChE,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,IAAA,eAAO,EAAC,KAAK,CAAkB,CAAC;AACzC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"account-signer.js","sourceRoot":"","sources":["../../src/account-signer.ts"],"names":[],"mappings":";;;AAAA,uCASsB;AACtB,oEAAwD;AACxD,gDAA+C;AAM/C,+BAAsD;AAGtD,MAAM,eAAe,GAAG,CAAC,KAAU,EAA6B,EAAE;IAChE,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,IAAA,eAAO,EAAC,KAAK,CAAkB,CAAC;AACzC,CAAC,CAAC;AAKF,MAAa,aAGX,SAAQ,wBAAM;IAad,YAAmB,QAA+B,EAAE,OAAiB;QACnE,KAAK,EAAE,CAAC;QADE;;;;mBAAO,QAAQ;WAAuB;QAZzC;;;;;WAAkB;QAE3B;;;;;WAAkB;QAClB;;;;;WAAgC;QAW9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,CAAC,iBAAiB,GAAG,CACvB,IAAwD,EACxD,SAAsD,EACtD,EAAE,CACF,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,iBAAiB,CAAC;YAC9C,EAAE,EAAE,IAAI;YACR,OAAO;YACP,SAAS;SACV,CAAC,CAAC;QAEL,I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E,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK;YAC1C,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED,eAAe,CACb,YAA4C;QAE5C,MAAM,IAAI,KAAK,CACb,qEAAqE,CACtE,CAAC;IACJ,CAAC;IAED,sBAAsB;QACpB,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC;IAC1C,CAAC;IAED,OAAO,CAAC,QAA+B;QACrC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA5FD,sCA4FC","sourcesContent":["import {\n AccountNotFoundError,\n resolveProperties,\n type BatchUserOperationCallData,\n type BundlerClient,\n type GetEntryPointFromAccount,\n type SmartContractAccount,\n type UserOperationCallData,\n type UserOperationOverrides,\n} from \"@aa-sdk/core\";\nimport { Signer } from \"@ethersproject/abstract-signer\";\nimport { hexlify } from \"@ethersproject/bytes\";\nimport type { Deferrable } from \"@ethersproject/properties\";\nimport {\n type TransactionRequest,\n type TransactionResponse,\n} from \"@ethersproject/providers\";\nimport { isHex, toBytes, type Transport } from \"viem\";\nimport { EthersProviderAdapter } from \"./provider-adapter.js\";\n\nconst hexlifyOptional = (value: any): `0x${string}` | undefined => {\n if (value == null) {\n return undefined;\n }\n\n return hexlify(value) as `0x${string}`;\n};\n\n/**\n * Implementation of the ethers Signer interface to use with Smart Contract Accounts\n */\nexport class AccountSigner<\n TAccount extends SmartContractAccount = SmartContractAccount,\n TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>\n> extends Signer {\n readonly account: TAccount;\n\n sendUserOperation;\n waitForUserOperationTransaction;\n\n /**\n * Creates a new AccountSigner with the given ethers Provider and Smart Contract Account\n *\n * @template {SmartContractAccount} TAccount the type of the smart contract account\n * @param {EthersProviderAdapter} provider the ethers provider to use\n * @param {TAccount} account the smart contract account that will be used to sign user ops and send them\n */\n constructor(public provider: EthersProviderAdapter, account: TAccount) {\n super();\n this.account = account;\n\n this.sendUserOperation = (\n args: UserOperationCallData | BatchUserOperationCallData,\n overrides?: UserOperationOverrides<TEntryPointVersion>\n ) =>\n this.provider.accountProvider.sendUserOperation({\n uo: args,\n account,\n overrides,\n });\n\n this.waitForUserOperationTransaction =\n this.provider.accountProvider.waitForUserOperationTransaction.bind(\n this.provider.accountProvider\n );\n }\n\n async getAddress(): Promise<string> {\n if (!this.account) {\n throw new AccountNotFoundError();\n }\n\n return this.account.address;\n }\n\n signMessage(message: string | Uint8Array): Promise<string> {\n if (!this.account) {\n throw new AccountNotFoundError();\n }\n\n return this.account.signMessage({\n message:\n typeof message === \"string\" && !isHex(message)\n ? message\n : { raw: isHex(message) ? toBytes(message) : message },\n });\n }\n\n async sendTransaction(\n transaction: Deferrable<TransactionRequest>\n ): Promise<TransactionResponse> {\n if (!this.provider.accountProvider.account || !this.account) {\n throw new AccountNotFoundError();\n }\n\n const resolved = await resolveProperties(transaction);\n const txHash = await this.provider.accountProvider.sendTransaction({\n to: resolved.to as `0x${string}` | undefined,\n data: hexlifyOptional(resolved.data),\n chain: this.provider.accountProvider.chain,\n account: this.account,\n });\n\n return this.provider.getTransaction(txHash);\n }\n\n signTransaction(\n _transaction: Deferrable<TransactionRequest>\n ): Promise<string> {\n throw new Error(\n \"Transaction signing is not supported, use sendUserOperation instead\"\n );\n }\n\n getPublicErc4337Client(): BundlerClient<Transport> {\n return this.provider.getBundlerClient();\n }\n\n connect(provider: EthersProviderAdapter): AccountSigner<TAccount> {\n this.provider = provider;\n\n return this;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-signer.js","sourceRoot":"","sources":["../../src/account-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,GAOlB,MAAM,cAAc,C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,CAAC,CAAC;QACtD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,eAAe,CAAC;YACjE,EAAE,EAAE,QAAQ,CAAC,EAA+B;YAC5C,IAAI,EAAE,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC;YACpC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK;YAC1C,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED,eAAe,CACb,YAA4C;QAE5C,MAAM,IAAI,KAAK,CACb,qEAAqE,CACtE,CAAC;IACJ,CAAC;IAED,sBAAsB;QACpB,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC;IAC1C,CAAC;IAED,OAAO,CAAC,QAA+B;QACrC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["import {\n AccountNotFoundError,\n resolveProperties,\n type BatchUserOperationCallData,\n type BundlerClient,\n type GetEntryPointFromAccount,\n type SmartContractAccount,\n type UserOperationCallData,\n type UserOperationOverrides,\n} from \"@aa-sdk/core\";\nimport { Signer } from \"@ethersproject/abstract-signer\";\nimport { hexlify } from \"@ethersproject/bytes\";\nimport type { Deferrable } from \"@ethersproject/properties\";\nimport {\n type TransactionRequest,\n type TransactionResponse,\n} from \"@ethersproject/providers\";\nimport { isHex, toBytes, type Transport } from \"viem\";\nimport { EthersProviderAdapter } from \"./provider-adapter.js\";\n\nconst hexlifyOptional = (value: any): `0x${string}` | undefined => {\n if (value == null) {\n return undefined;\n }\n\n return hexlify(value) as `0x${string}`;\n};\n\n/**\n * Implementation of the ethers Signer interface to use with Smart Contract Accounts\n */\nexport class AccountSigner<\n TAccount extends SmartContractAccount = SmartContractAccount,\n TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>\n> extends Signer {\n readonly account: TAccount;\n\n sendUserOperation;\n waitForUserOperationTransaction;\n\n /**\n * Creates a new AccountSigner with the given ethers Provider and Smart Contract Account\n *\n * @template {SmartContractAccount} TAccount the type of the smart contract account\n * @param {EthersProviderAdapter} provider the ethers provider to use\n * @param {TAccount} account the smart contract account that will be used to sign user ops and send them\n */\n constructor(public provider: EthersProviderAdapter, account: TAccount) {\n super();\n this.account = account;\n\n this.sendUserOperation = (\n args: UserOperationCallData | BatchUserOperationCallData,\n overrides?: UserOperationOverrides<TEntryPointVersion>\n ) =>\n this.provider.accountProvider.sendUserOperation({\n uo: args,\n account,\n overrides,\n });\n\n this.waitForUserOperationTransaction =\n this.provider.accountProvider.waitForUserOperationTransaction.bind(\n this.provider.accountProvider\n );\n }\n\n async getAddress(): Promise<string> {\n if (!this.account) {\n throw new AccountNotFoundError();\n }\n\n return this.account.address;\n }\n\n signMessage(message: string | Uint8Array): Promise<string> {\n if (!this.account) {\n throw new AccountNotFoundError();\n }\n\n return this.account.signMessage({\n message:\n typeof message === \"string\" && !isHex(message)\n ? message\n : { raw: isHex(message) ? toBytes(message) : message },\n });\n }\n\n async sendTransaction(\n transaction: Deferrable<TransactionRequest>\n ): Promise<TransactionResponse> {\n if (!this.provider.accountProvider.account || !this.account) {\n throw new AccountNotFoundError();\n }\n\n const resolved = await resolveProperties(transaction);\n const txHash = await this.provider.accountProvider.sendTransaction({\n to: resolved.to as `0x${string}` | undefined,\n data: hexlifyOptional(resolved.data),\n chain: this.provider.accountProvider.chain,\n account: this.account,\n });\n\n return this.provider.getTransaction(txHash);\n }\n\n signTransaction(\n _transaction: Deferrable<TransactionRequest>\n ): Promise<string> {\n throw new Error(\n \"Transaction signing is not supported, use sendUserOperation instead\"\n );\n }\n\n getPublicErc4337Client(): BundlerClient<Transport> {\n return this.provider.getBundlerClient();\n }\n\n connect(provider: EthersProviderAdapter): AccountSigner<TAccount> {\n this.provider = provider;\n\n return this;\n }\n}\n"]}
|
|
@@ -4,11 +4,21 @@ import type { Deferrable } from "@ethersproject/properties";
|
|
|
4
4
|
import { type TransactionRequest, type TransactionResponse } from "@ethersproject/providers";
|
|
5
5
|
import { type Transport } from "viem";
|
|
6
6
|
import { EthersProviderAdapter } from "./provider-adapter.js";
|
|
7
|
+
/**
|
|
8
|
+
* Implementation of the ethers Signer interface to use with Smart Contract Accounts
|
|
9
|
+
*/
|
|
7
10
|
export declare class AccountSigner<TAccount extends SmartContractAccount = SmartContractAccount, TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>> extends Signer {
|
|
8
11
|
provider: EthersProviderAdapter;
|
|
9
12
|
readonly account: TAccount;
|
|
10
13
|
sendUserOperation: (args: UserOperationCallData | BatchUserOperationCallData, overrides?: UserOperationOverrides<TEntryPointVersion>) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
|
|
11
14
|
waitForUserOperationTransaction: (args: import("@aa-sdk/core").WaitForUserOperationTxParameters) => Promise<`0x${string}`>;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new AccountSigner with the given ethers Provider and Smart Contract Account
|
|
17
|
+
*
|
|
18
|
+
* @template {SmartContractAccount} TAccount the type of the smart contract account
|
|
19
|
+
* @param {EthersProviderAdapter} provider the ethers provider to use
|
|
20
|
+
* @param {TAccount} account the smart contract account that will be used to sign user ops and send them
|
|
21
|
+
*/
|
|
12
22
|
constructor(provider: EthersProviderAdapter, account: TAccount);
|
|
13
23
|
getAddress(): Promise<string>;
|
|
14
24
|
signMessage(message: string | Uint8Array): Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-signer.d.ts","sourceRoot":"","sources":["../../src/account-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,oB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G,SAAQ,MAAM;IAaK,QAAQ,EAAE,qBAAqB;IAZlD,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAE3B,iBAAiB,SAeP,qBAAqB,GAAG,0BAA0B,cAC5C,uBAAuB,kBAAkB,CAAC,2HAhBxC;IAClB,+BAA+B,4FAAC;IAEhC;;;;;;OAMG;gBACgB,QAAQ,EAAE,qBAAqB,EAAE,OAAO,EAAE,QAAQ;IAoB/D,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAQnC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAapD,eAAe,CACnB,WAAW,EAAE,UAAU,CAAC,kBAAkB,CAAC,GAC1C,OAAO,CAAC,mBAAmB,CAAC;IAgB/B,eAAe,CACb,YAAY,EAAE,UAAU,CAAC,kBAAkB,CAAC,GAC3C,OAAO,CAAC,MAAM,CAAC;IAMlB,sBAAsB,IAAI,aAAa,CAAC,SAAS,CAAC;IAIlD,OAAO,CAAC,QAAQ,EAAE,qBAAqB,GAAG,aAAa,CAAC,QAAQ,CAAC;CAKlE"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aa-sdk/ethers",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "4.0.0-alpha.
|
|
4
|
+
"version": "4.0.0-alpha.1",
|
|
5
5
|
"description": "Ethers.js wrapper for @aa-sdk/core",
|
|
6
6
|
"author": "Alchemy",
|
|
7
7
|
"type": "module",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"vitest": "^0.31.0"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@aa-sdk/core": "^4.0.0-alpha.
|
|
52
|
+
"@aa-sdk/core": "^4.0.0-alpha.1",
|
|
53
53
|
"@ethersproject/abi": "^5.7.0",
|
|
54
54
|
"@ethersproject/abstract-signer": "^5.7.0",
|
|
55
55
|
"@ethersproject/bytes": "^5.7.0",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"bugs": {
|
|
71
71
|
"url": "https://github.com/alchemyplatform/aa-sdk/issues"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "cb4bf5f8a9aa8fdff1610130821b69ff806e79e6"
|
|
74
74
|
}
|
package/src/account-signer.ts
CHANGED
|
@@ -26,6 +26,9 @@ const hexlifyOptional = (value: any): `0x${string}` | undefined => {
|
|
|
26
26
|
return hexlify(value) as `0x${string}`;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Implementation of the ethers Signer interface to use with Smart Contract Accounts
|
|
31
|
+
*/
|
|
29
32
|
export class AccountSigner<
|
|
30
33
|
TAccount extends SmartContractAccount = SmartContractAccount,
|
|
31
34
|
TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
|
|
@@ -35,6 +38,13 @@ export class AccountSigner<
|
|
|
35
38
|
sendUserOperation;
|
|
36
39
|
waitForUserOperationTransaction;
|
|
37
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Creates a new AccountSigner with the given ethers Provider and Smart Contract Account
|
|
43
|
+
*
|
|
44
|
+
* @template {SmartContractAccount} TAccount the type of the smart contract account
|
|
45
|
+
* @param {EthersProviderAdapter} provider the ethers provider to use
|
|
46
|
+
* @param {TAccount} account the smart contract account that will be used to sign user ops and send them
|
|
47
|
+
*/
|
|
38
48
|
constructor(public provider: EthersProviderAdapter, account: TAccount) {
|
|
39
49
|
super();
|
|
40
50
|
this.account = account;
|