@aztec/node-keystore 2.0.0-nightly.20250816
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.
- package/dest/index.d.ts +6 -0
- package/dest/index.d.ts.map +1 -0
- package/dest/index.js +5 -0
- package/dest/keystore_manager.d.ts +123 -0
- package/dest/keystore_manager.d.ts.map +1 -0
- package/dest/keystore_manager.js +511 -0
- package/dest/loader.d.ts +62 -0
- package/dest/loader.d.ts.map +1 -0
- package/dest/loader.js +255 -0
- package/dest/schemas.d.ts +965 -0
- package/dest/schemas.d.ts.map +1 -0
- package/dest/schemas.js +83 -0
- package/dest/signer.d.ts +85 -0
- package/dest/signer.d.ts.map +1 -0
- package/dest/signer.js +148 -0
- package/dest/types.d.ts +98 -0
- package/dest/types.d.ts.map +1 -0
- package/dest/types.js +7 -0
- package/package.json +89 -0
- package/src/index.ts +5 -0
- package/src/keystore_manager.ts +646 -0
- package/src/loader.ts +301 -0
- package/src/schemas.ts +91 -0
- package/src/signer.ts +227 -0
- package/src/types.ts +112 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keys and Addresses Configuration Types
|
|
3
|
+
*
|
|
4
|
+
* TypeScript definitions based on the specification for validator keystore files.
|
|
5
|
+
* These types define the JSON structure for configuring validators, provers, and
|
|
6
|
+
* their associated keys and addresses.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** Parameterized hex string type for specific byte lengths */
|
|
10
|
+
export type Hex<TByteLength extends number> = `0x${string}` & { readonly _length: TByteLength };
|
|
11
|
+
|
|
12
|
+
/** A json keystore config points to a local file with the encrypted private key, and may require a password for decrypting it */
|
|
13
|
+
export type EthJsonKeyFileV3Config = { path: string; password?: string };
|
|
14
|
+
|
|
15
|
+
/** A private key is a 32-byte 0x-prefixed hex */
|
|
16
|
+
export type EthPrivateKey = Hex<32>;
|
|
17
|
+
|
|
18
|
+
/** An address is a 20-byte 0x-prefixed hex */
|
|
19
|
+
export type EthAddressHex = Hex<20>;
|
|
20
|
+
|
|
21
|
+
/** An Aztec address is a 32-byte 0x-prefixed hex */
|
|
22
|
+
export type AztecAddressHex = Hex<32>;
|
|
23
|
+
|
|
24
|
+
/** URL type for remote signers */
|
|
25
|
+
export type Url = string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A remote signer is configured as an URL to connect to, and optionally a client certificate to use for auth
|
|
29
|
+
*/
|
|
30
|
+
export type EthRemoteSignerConfig =
|
|
31
|
+
| Url
|
|
32
|
+
| {
|
|
33
|
+
remoteSignerUrl: Url;
|
|
34
|
+
certPath?: string;
|
|
35
|
+
certPass?: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A remote signer account config is equal to the remote signer config, but requires an address to be specified.
|
|
40
|
+
* If only the address is set, then the default remote signer config from the parent config is used.
|
|
41
|
+
*/
|
|
42
|
+
export type EthRemoteSignerAccount =
|
|
43
|
+
| EthAddressHex
|
|
44
|
+
| {
|
|
45
|
+
address: EthAddressHex;
|
|
46
|
+
remoteSignerUrl?: Url;
|
|
47
|
+
certPath?: string;
|
|
48
|
+
certPass?: string;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** An L1 account is a private key, a remote signer configuration, or a standard json key store file */
|
|
52
|
+
export type EthAccount = EthPrivateKey | EthRemoteSignerAccount | EthJsonKeyFileV3Config;
|
|
53
|
+
|
|
54
|
+
/** A mnemonic can be used to define a set of accounts */
|
|
55
|
+
export type EthMnemonicConfig = {
|
|
56
|
+
mnemonic: string;
|
|
57
|
+
addressIndex?: number;
|
|
58
|
+
accountIndex?: number;
|
|
59
|
+
addressCount?: number;
|
|
60
|
+
accountCount?: number;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/** One or more L1 accounts */
|
|
64
|
+
export type EthAccounts = EthAccount | EthAccount[] | EthMnemonicConfig;
|
|
65
|
+
|
|
66
|
+
export type ProverKeyStore =
|
|
67
|
+
| {
|
|
68
|
+
/** Address that identifies the prover. This address will receive the rewards. */
|
|
69
|
+
id: EthAddressHex;
|
|
70
|
+
/** One or more EOAs used for sending proof L1 txs. */
|
|
71
|
+
publisher: EthAccounts[];
|
|
72
|
+
}
|
|
73
|
+
| EthAccount;
|
|
74
|
+
|
|
75
|
+
export type ValidatorKeyStore = {
|
|
76
|
+
/**
|
|
77
|
+
* One or more validator attester keys to handle in this configuration block.
|
|
78
|
+
* An attester address may only appear once across all configuration blocks across all keystore files.
|
|
79
|
+
*/
|
|
80
|
+
attester: EthAccounts;
|
|
81
|
+
/**
|
|
82
|
+
* Coinbase address to use when proposing an L2 block as any of the validators in this configuration block.
|
|
83
|
+
* Falls back to the attester address if not set.
|
|
84
|
+
*/
|
|
85
|
+
coinbase?: EthAddressHex;
|
|
86
|
+
/**
|
|
87
|
+
* One or more EOAs used for sending block proposal L1 txs for all validators in this configuration block.
|
|
88
|
+
* Falls back to the attester account if not set.
|
|
89
|
+
*/
|
|
90
|
+
publisher?: EthAccounts;
|
|
91
|
+
/**
|
|
92
|
+
* Fee recipient address to use when proposing an L2 block as any of the validators in this configuration block.
|
|
93
|
+
*/
|
|
94
|
+
feeRecipient: AztecAddressHex;
|
|
95
|
+
/**
|
|
96
|
+
* Default remote signer for all accounts in this block.
|
|
97
|
+
*/
|
|
98
|
+
remoteSigner?: EthRemoteSignerConfig;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export type KeyStore = {
|
|
102
|
+
/** Schema version of this keystore file (initially 1). */
|
|
103
|
+
schemaVersion: number;
|
|
104
|
+
/** Validator configurations. */
|
|
105
|
+
validators?: ValidatorKeyStore[];
|
|
106
|
+
/** One or more accounts used for creating slash payloads on L1. Does not create slash payloads if not set. */
|
|
107
|
+
slasher?: EthAccounts;
|
|
108
|
+
/** Default config for the remote signer for all accounts in this file. */
|
|
109
|
+
remoteSigner?: EthRemoteSignerConfig;
|
|
110
|
+
/** Prover configuration. Only one prover configuration is allowed. */
|
|
111
|
+
prover?: ProverKeyStore;
|
|
112
|
+
};
|