@aztec/validator-client 3.0.0-nightly.20251031 → 3.0.0-nightly.20251102
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":"web3signer_key_store.d.ts","sourceRoot":"","sources":["../../src/key_store/web3signer_key_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"web3signer_key_store.d.ts","sourceRoot":"","sources":["../../src/key_store/web3signer_key_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAE5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAEhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD;;;;;GAKG;AACH,qBAAa,kBAAmB,YAAW,iBAAiB;IAExD,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,OAAO;gBADP,SAAS,EAAE,UAAU,EAAE,EACvB,OAAO,EAAE,MAAM;IAGzB;;;;;OAKG;IACI,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAO5C;;;;OAIG;IACI,YAAY,IAAI,UAAU,EAAE;IAInC;;;;OAIG;IACI,aAAa,CAAC,SAAS,EAAE,mBAAmB,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAI1E;;;;;;OAMG;IACU,wBAAwB,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC;IAQ9G;;;;;OAKG;IACI,WAAW,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAI3D;;;;;;OAMG;IACU,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;IAO/F;;;;;OAKG;YACW,sBAAsB;YAiDtB,+BAA+B;CA6C9C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { normalizeSignature } from '@aztec/foundation/crypto';
|
|
1
2
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
2
3
|
/**
|
|
3
4
|
* Web3Signer Key Store
|
|
@@ -33,9 +34,8 @@ import { Signature } from '@aztec/foundation/eth-signature';
|
|
|
33
34
|
* Sign EIP-712 typed data with all keystore addresses
|
|
34
35
|
* @param typedData - The complete EIP-712 typed data structure (domain, types, primaryType, message)
|
|
35
36
|
* @return signatures
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
return signatures;
|
|
37
|
+
*/ signTypedData(typedData) {
|
|
38
|
+
return Promise.all(this.addresses.map((address)=>this.makeJsonRpcSignTypedDataRequest(address, typedData)));
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Sign EIP-712 typed data with a specific address
|
|
@@ -54,9 +54,8 @@ import { Signature } from '@aztec/foundation/eth-signature';
|
|
|
54
54
|
*
|
|
55
55
|
* @param message - The message to sign
|
|
56
56
|
* @return signatures
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
|
-
return signatures;
|
|
57
|
+
*/ signMessage(message) {
|
|
58
|
+
return Promise.all(this.addresses.map((address)=>this.makeJsonRpcSignRequest(address, message)));
|
|
60
59
|
}
|
|
61
60
|
/**
|
|
62
61
|
* Sign a message with a specific address using EIP-191 prefix
|
|
@@ -112,7 +111,7 @@ import { Signature } from '@aztec/foundation/eth-signature';
|
|
|
112
111
|
signatureHex = '0x' + signatureHex;
|
|
113
112
|
}
|
|
114
113
|
// Parse the signature from the hex string
|
|
115
|
-
return Signature.fromString(signatureHex);
|
|
114
|
+
return normalizeSignature(Signature.fromString(signatureHex));
|
|
116
115
|
}
|
|
117
116
|
async makeJsonRpcSignTypedDataRequest(address, typedData) {
|
|
118
117
|
const url = this.baseUrl;
|
|
@@ -148,6 +147,6 @@ import { Signature } from '@aztec/foundation/eth-signature';
|
|
|
148
147
|
if (!signatureHex.startsWith('0x')) {
|
|
149
148
|
signatureHex = '0x' + signatureHex;
|
|
150
149
|
}
|
|
151
|
-
return Signature.fromString(signatureHex);
|
|
150
|
+
return normalizeSignature(Signature.fromString(signatureHex));
|
|
152
151
|
}
|
|
153
152
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/validator-client",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20251102",
|
|
4
4
|
"main": "dest/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -64,16 +64,16 @@
|
|
|
64
64
|
]
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
68
|
-
"@aztec/epoch-cache": "3.0.0-nightly.
|
|
69
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
70
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
71
|
-
"@aztec/node-keystore": "3.0.0-nightly.
|
|
72
|
-
"@aztec/p2p": "3.0.0-nightly.
|
|
73
|
-
"@aztec/prover-client": "3.0.0-nightly.
|
|
74
|
-
"@aztec/slasher": "3.0.0-nightly.
|
|
75
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
76
|
-
"@aztec/telemetry-client": "3.0.0-nightly.
|
|
67
|
+
"@aztec/constants": "3.0.0-nightly.20251102",
|
|
68
|
+
"@aztec/epoch-cache": "3.0.0-nightly.20251102",
|
|
69
|
+
"@aztec/ethereum": "3.0.0-nightly.20251102",
|
|
70
|
+
"@aztec/foundation": "3.0.0-nightly.20251102",
|
|
71
|
+
"@aztec/node-keystore": "3.0.0-nightly.20251102",
|
|
72
|
+
"@aztec/p2p": "3.0.0-nightly.20251102",
|
|
73
|
+
"@aztec/prover-client": "3.0.0-nightly.20251102",
|
|
74
|
+
"@aztec/slasher": "3.0.0-nightly.20251102",
|
|
75
|
+
"@aztec/stdlib": "3.0.0-nightly.20251102",
|
|
76
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20251102",
|
|
77
77
|
"koa": "^2.16.1",
|
|
78
78
|
"koa-router": "^13.1.1",
|
|
79
79
|
"tslib": "^2.4.0",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
|
+
import { normalizeSignature } from '@aztec/foundation/crypto';
|
|
2
3
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
4
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
4
5
|
|
|
@@ -45,11 +46,8 @@ export class Web3SignerKeyStore implements ValidatorKeyStore {
|
|
|
45
46
|
* @param typedData - The complete EIP-712 typed data structure (domain, types, primaryType, message)
|
|
46
47
|
* @return signatures
|
|
47
48
|
*/
|
|
48
|
-
public
|
|
49
|
-
|
|
50
|
-
this.addresses.map(address => this.makeJsonRpcSignTypedDataRequest(address, typedData)),
|
|
51
|
-
);
|
|
52
|
-
return signatures;
|
|
49
|
+
public signTypedData(typedData: TypedDataDefinition): Promise<Signature[]> {
|
|
50
|
+
return Promise.all(this.addresses.map(address => this.makeJsonRpcSignTypedDataRequest(address, typedData)));
|
|
53
51
|
}
|
|
54
52
|
|
|
55
53
|
/**
|
|
@@ -73,9 +71,8 @@ export class Web3SignerKeyStore implements ValidatorKeyStore {
|
|
|
73
71
|
* @param message - The message to sign
|
|
74
72
|
* @return signatures
|
|
75
73
|
*/
|
|
76
|
-
public
|
|
77
|
-
|
|
78
|
-
return signatures;
|
|
74
|
+
public signMessage(message: Buffer32): Promise<Signature[]> {
|
|
75
|
+
return Promise.all(this.addresses.map(address => this.makeJsonRpcSignRequest(address, message)));
|
|
79
76
|
}
|
|
80
77
|
|
|
81
78
|
/**
|
|
@@ -144,7 +141,7 @@ export class Web3SignerKeyStore implements ValidatorKeyStore {
|
|
|
144
141
|
}
|
|
145
142
|
|
|
146
143
|
// Parse the signature from the hex string
|
|
147
|
-
return Signature.fromString(signatureHex as `0x${string}`);
|
|
144
|
+
return normalizeSignature(Signature.fromString(signatureHex as `0x${string}`));
|
|
148
145
|
}
|
|
149
146
|
|
|
150
147
|
private async makeJsonRpcSignTypedDataRequest(
|
|
@@ -190,6 +187,6 @@ export class Web3SignerKeyStore implements ValidatorKeyStore {
|
|
|
190
187
|
signatureHex = '0x' + signatureHex;
|
|
191
188
|
}
|
|
192
189
|
|
|
193
|
-
return Signature.fromString(signatureHex as `0x${string}`);
|
|
190
|
+
return normalizeSignature(Signature.fromString(signatureHex as `0x${string}`));
|
|
194
191
|
}
|
|
195
192
|
}
|