@toruslabs/ethereum-controllers 4.8.0 → 4.9.0

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.
@@ -11,7 +11,7 @@ export default class KeyringController extends BaseKeyringController<Partial<Bas
11
11
  importAccount(accountPrivateKey: string): string;
12
12
  removeAccount(address: string): void;
13
13
  getBufferPrivateKey(privateKey: string): Buffer;
14
- signMessage(data: string, address: string): string;
14
+ signMessage(data: string, address: string): Promise<string>;
15
15
  signPersonalMessage(data: string, address: string): Promise<string>;
16
16
  signTypedData<V extends SignTypedDataVersion, T extends MessageTypes>(typedData: V extends "V1" ? TypedDataV1 : TypedMessage<T>, address: string, version: V): Promise<string>;
17
17
  signEncryptionPublicKey(address: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toruslabs/ethereum-controllers",
3
- "version": "4.8.0",
3
+ "version": "4.9.0",
4
4
  "homepage": "https://github.com/torusresearch/controllers#readme",
5
5
  "license": "ISC",
6
6
  "main": "dist/ethereumControllers.cjs.js",
@@ -64,7 +64,7 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "3cbca56257bef728066d41f588323f2ce41773cd",
67
+ "gitHead": "49adaf20315ce8e194679e32fd18b0379b5779d6",
68
68
  "devDependencies": {
69
69
  "hardhat": "^2.19.0"
70
70
  }
@@ -72,7 +72,7 @@ export default class KeyringController extends BaseKeyringController<Partial<Bas
72
72
  }
73
73
 
74
74
  // For eth_sign, we need to sign arbitrary data:
75
- signMessage(data: string, address: string) {
75
+ async signMessage(data: string, address: string): Promise<string> {
76
76
  const wallet = this._getWalletForAccount(address);
77
77
  const privKey = this.getBufferPrivateKey(wallet.privateKey);
78
78
  const messageSig = ecsign(Buffer.from(stripHexPrefix(data), "hex"), privKey);
@@ -34,7 +34,7 @@ export class MessageController extends AbstractMessageController<Message, Messag
34
34
  try {
35
35
  const msgObject = this.getMessage(messageId);
36
36
  const cleanMsgParams = await this.approveMessage(messageId, msgObject.messageParams);
37
- const rawSig = this.signMessage(cleanMsgParams.data, cleanMsgParams.from);
37
+ const rawSig = await this.signMessage(cleanMsgParams.data, cleanMsgParams.from);
38
38
  this.updateMessage({ ...msgObject, rawSig });
39
39
  this.setMessageStatus(messageId, MessageStatus.SIGNED);
40
40
  return rawSig;