@aztec/bot 3.0.0-nightly.20250905 → 4.0.0-nightly.20250907
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/config.d.ts +13 -13
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +7 -3
- package/dest/factory.js +1 -1
- package/package.json +11 -11
- package/src/config.ts +11 -7
- package/src/factory.ts +1 -1
package/dest/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ConfigMappingsType,
|
|
1
|
+
import { type ConfigMappingsType, SecretValue } from '@aztec/foundation/config';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import { type ZodFor } from '@aztec/stdlib/schemas';
|
|
4
4
|
import type { ComponentsVersions } from '@aztec/stdlib/versioning';
|
|
@@ -19,13 +19,13 @@ export type BotConfig = {
|
|
|
19
19
|
/** Url of the ethereum host. */
|
|
20
20
|
l1RpcUrls: string[] | undefined;
|
|
21
21
|
/** The mnemonic for the account to bridge fee juice from L1. */
|
|
22
|
-
l1Mnemonic: SecretValue<string | undefined
|
|
22
|
+
l1Mnemonic: SecretValue<string> | undefined;
|
|
23
23
|
/** The private key for the account to bridge fee juice from L1. */
|
|
24
|
-
l1PrivateKey: SecretValue<string | undefined
|
|
24
|
+
l1PrivateKey: SecretValue<string> | undefined;
|
|
25
25
|
/** How long to wait for L1 to L2 messages to become available on L2 */
|
|
26
26
|
l1ToL2MessageTimeoutSeconds: number;
|
|
27
27
|
/** Signing private key for the sender account. */
|
|
28
|
-
senderPrivateKey: SecretValue<Fr | undefined
|
|
28
|
+
senderPrivateKey: SecretValue<Fr> | undefined;
|
|
29
29
|
/** Optional salt to use to instantiate the sender account */
|
|
30
30
|
senderSalt: Fr | undefined;
|
|
31
31
|
/** Encryption secret for a recipient account. */
|
|
@@ -68,10 +68,10 @@ export declare const BotConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
68
68
|
nodeAdminUrl: z.ZodOptional<z.ZodString>;
|
|
69
69
|
pxeUrl: z.ZodOptional<z.ZodString>;
|
|
70
70
|
l1RpcUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
71
|
-
l1Mnemonic: z.ZodType<SecretValue<string
|
|
72
|
-
l1PrivateKey: z.ZodType<SecretValue<string
|
|
71
|
+
l1Mnemonic: z.ZodOptional<z.ZodType<SecretValue<string>, any, any>>;
|
|
72
|
+
l1PrivateKey: z.ZodOptional<z.ZodType<SecretValue<string>, any, any>>;
|
|
73
73
|
l1ToL2MessageTimeoutSeconds: z.ZodNumber;
|
|
74
|
-
senderPrivateKey: z.ZodType<SecretValue<Fr
|
|
74
|
+
senderPrivateKey: z.ZodOptional<z.ZodType<SecretValue<Fr>, any, any>>;
|
|
75
75
|
senderSalt: z.ZodOptional<ZodFor<Fr>>;
|
|
76
76
|
recipientEncryptionSecret: z.ZodType<SecretValue<Fr>, any, any>;
|
|
77
77
|
tokenSalt: ZodFor<Fr>;
|
|
@@ -91,10 +91,7 @@ export declare const BotConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
91
91
|
stopWhenUnhealthy: z.ZodBoolean;
|
|
92
92
|
ammTxs: z.ZodDefault<z.ZodBoolean>;
|
|
93
93
|
}, "strip", z.ZodTypeAny, {
|
|
94
|
-
l1Mnemonic: SecretValue<string | undefined>;
|
|
95
|
-
l1PrivateKey: SecretValue<string | undefined>;
|
|
96
94
|
l1ToL2MessageTimeoutSeconds: number;
|
|
97
|
-
senderPrivateKey: SecretValue<Fr | undefined>;
|
|
98
95
|
recipientEncryptionSecret: SecretValue<Fr>;
|
|
99
96
|
tokenSalt: Fr;
|
|
100
97
|
txIntervalSeconds: number;
|
|
@@ -114,6 +111,9 @@ export declare const BotConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
114
111
|
nodeAdminUrl?: string | undefined;
|
|
115
112
|
pxeUrl?: string | undefined;
|
|
116
113
|
l1RpcUrls?: string[] | undefined;
|
|
114
|
+
l1Mnemonic?: SecretValue<string> | undefined;
|
|
115
|
+
l1PrivateKey?: SecretValue<string> | undefined;
|
|
116
|
+
senderPrivateKey?: SecretValue<Fr> | undefined;
|
|
117
117
|
senderSalt?: Fr | undefined;
|
|
118
118
|
l2GasLimit?: number | undefined;
|
|
119
119
|
daGasLimit?: number | undefined;
|
|
@@ -145,10 +145,7 @@ export declare const BotConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
145
145
|
daGasLimit?: number | undefined;
|
|
146
146
|
ammTxs?: boolean | undefined;
|
|
147
147
|
}>, {
|
|
148
|
-
l1Mnemonic: SecretValue<string | undefined>;
|
|
149
|
-
l1PrivateKey: SecretValue<string | undefined>;
|
|
150
148
|
l1ToL2MessageTimeoutSeconds: number;
|
|
151
|
-
senderPrivateKey: SecretValue<Fr | undefined>;
|
|
152
149
|
recipientEncryptionSecret: SecretValue<Fr>;
|
|
153
150
|
tokenSalt: Fr;
|
|
154
151
|
txIntervalSeconds: number;
|
|
@@ -168,6 +165,9 @@ export declare const BotConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
168
165
|
nodeAdminUrl: string | undefined;
|
|
169
166
|
pxeUrl: string | undefined;
|
|
170
167
|
l1RpcUrls: string[] | undefined;
|
|
168
|
+
l1Mnemonic: SecretValue<string> | undefined;
|
|
169
|
+
l1PrivateKey: SecretValue<string> | undefined;
|
|
170
|
+
senderPrivateKey: SecretValue<Fr> | undefined;
|
|
171
171
|
senderSalt: Fr | undefined;
|
|
172
172
|
l2GasLimit: number | undefined;
|
|
173
173
|
daGasLimit: number | undefined;
|
package/dest/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kB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
l1RpcUrls: z.array(z.string()).optional(),
|
|
22
|
-
l1Mnemonic: schemas.SecretValue(z.string().optional()
|
|
23
|
-
l1PrivateKey: schemas.SecretValue(z.string().optional()
|
|
22
|
+
l1Mnemonic: schemas.SecretValue(z.string()).optional(),
|
|
23
|
+
l1PrivateKey: schemas.SecretValue(z.string()).optional(),
|
|
24
24
|
l1ToL2MessageTimeoutSeconds: z.number(),
|
|
25
|
-
senderPrivateKey: schemas.SecretValue(schemas.Fr.optional()
|
|
25
|
+
senderPrivateKey: schemas.SecretValue(schemas.Fr).optional(),
|
|
26
26
|
senderSalt: schemas.Fr.optional(),
|
|
27
27
|
recipientEncryptionSecret: schemas.SecretValue(schemas.Fr),
|
|
28
28
|
tokenSalt: schemas.Fr,
|
|
@@ -49,6 +49,9 @@ export const BotConfigSchema = z.object({
|
|
|
49
49
|
senderSalt: undefined,
|
|
50
50
|
l2GasLimit: undefined,
|
|
51
51
|
daGasLimit: undefined,
|
|
52
|
+
l1Mnemonic: undefined,
|
|
53
|
+
l1PrivateKey: undefined,
|
|
54
|
+
senderPrivateKey: undefined,
|
|
52
55
|
...config
|
|
53
56
|
}));
|
|
54
57
|
export const botConfigMappings = {
|
|
@@ -97,6 +100,7 @@ export const botConfigMappings = {
|
|
|
97
100
|
recipientEncryptionSecret: {
|
|
98
101
|
env: 'BOT_RECIPIENT_ENCRYPTION_SECRET',
|
|
99
102
|
description: 'Encryption secret for a recipient account.',
|
|
103
|
+
printDefault: (sv)=>sv?.getValue(),
|
|
100
104
|
...secretFrConfigHelper(Fr.fromHexString('0xcafecafe'))
|
|
101
105
|
},
|
|
102
106
|
tokenSalt: {
|
package/dest/factory.js
CHANGED
|
@@ -84,7 +84,7 @@ export class BotFactory {
|
|
|
84
84
|
* Checks if the sender account contract is initialized, and initializes it if necessary.
|
|
85
85
|
* @returns The sender wallet.
|
|
86
86
|
*/ async setupAccount() {
|
|
87
|
-
const privateKey = this.config.senderPrivateKey
|
|
87
|
+
const privateKey = this.config.senderPrivateKey?.getValue();
|
|
88
88
|
if (privateKey) {
|
|
89
89
|
return await this.setupAccountWithPrivateKey(privateKey);
|
|
90
90
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/bot",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-nightly.20250907",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -54,16 +54,16 @@
|
|
|
54
54
|
]
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@aztec/accounts": "
|
|
58
|
-
"@aztec/aztec.js": "
|
|
59
|
-
"@aztec/entrypoints": "
|
|
60
|
-
"@aztec/ethereum": "
|
|
61
|
-
"@aztec/foundation": "
|
|
62
|
-
"@aztec/noir-contracts.js": "
|
|
63
|
-
"@aztec/noir-protocol-circuits-types": "
|
|
64
|
-
"@aztec/protocol-contracts": "
|
|
65
|
-
"@aztec/stdlib": "
|
|
66
|
-
"@aztec/telemetry-client": "
|
|
57
|
+
"@aztec/accounts": "4.0.0-nightly.20250907",
|
|
58
|
+
"@aztec/aztec.js": "4.0.0-nightly.20250907",
|
|
59
|
+
"@aztec/entrypoints": "4.0.0-nightly.20250907",
|
|
60
|
+
"@aztec/ethereum": "4.0.0-nightly.20250907",
|
|
61
|
+
"@aztec/foundation": "4.0.0-nightly.20250907",
|
|
62
|
+
"@aztec/noir-contracts.js": "4.0.0-nightly.20250907",
|
|
63
|
+
"@aztec/noir-protocol-circuits-types": "4.0.0-nightly.20250907",
|
|
64
|
+
"@aztec/protocol-contracts": "4.0.0-nightly.20250907",
|
|
65
|
+
"@aztec/stdlib": "4.0.0-nightly.20250907",
|
|
66
|
+
"@aztec/telemetry-client": "4.0.0-nightly.20250907",
|
|
67
67
|
"source-map-support": "^0.5.21",
|
|
68
68
|
"tslib": "^2.4.0",
|
|
69
69
|
"zod": "^3.23.8"
|
package/src/config.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type ConfigMappingsType,
|
|
3
|
-
|
|
3
|
+
SecretValue,
|
|
4
4
|
booleanConfigHelper,
|
|
5
5
|
getConfigFromMappings,
|
|
6
6
|
getDefaultConfig,
|
|
@@ -35,13 +35,13 @@ export type BotConfig = {
|
|
|
35
35
|
/** Url of the ethereum host. */
|
|
36
36
|
l1RpcUrls: string[] | undefined;
|
|
37
37
|
/** The mnemonic for the account to bridge fee juice from L1. */
|
|
38
|
-
l1Mnemonic: SecretValue<string | undefined
|
|
38
|
+
l1Mnemonic: SecretValue<string> | undefined;
|
|
39
39
|
/** The private key for the account to bridge fee juice from L1. */
|
|
40
|
-
l1PrivateKey: SecretValue<string | undefined
|
|
40
|
+
l1PrivateKey: SecretValue<string> | undefined;
|
|
41
41
|
/** How long to wait for L1 to L2 messages to become available on L2 */
|
|
42
42
|
l1ToL2MessageTimeoutSeconds: number;
|
|
43
43
|
/** Signing private key for the sender account. */
|
|
44
|
-
senderPrivateKey: SecretValue<Fr | undefined
|
|
44
|
+
senderPrivateKey: SecretValue<Fr> | undefined;
|
|
45
45
|
/** Optional salt to use to instantiate the sender account */
|
|
46
46
|
senderSalt: Fr | undefined;
|
|
47
47
|
/** Encryption secret for a recipient account. */
|
|
@@ -86,10 +86,10 @@ export const BotConfigSchema = z
|
|
|
86
86
|
nodeAdminUrl: z.string().optional(),
|
|
87
87
|
pxeUrl: z.string().optional(),
|
|
88
88
|
l1RpcUrls: z.array(z.string()).optional(),
|
|
89
|
-
l1Mnemonic: schemas.SecretValue(z.string().optional()
|
|
90
|
-
l1PrivateKey: schemas.SecretValue(z.string().optional()
|
|
89
|
+
l1Mnemonic: schemas.SecretValue(z.string()).optional(),
|
|
90
|
+
l1PrivateKey: schemas.SecretValue(z.string()).optional(),
|
|
91
91
|
l1ToL2MessageTimeoutSeconds: z.number(),
|
|
92
|
-
senderPrivateKey: schemas.SecretValue(schemas.Fr.optional()
|
|
92
|
+
senderPrivateKey: schemas.SecretValue(schemas.Fr).optional(),
|
|
93
93
|
senderSalt: schemas.Fr.optional(),
|
|
94
94
|
recipientEncryptionSecret: schemas.SecretValue(schemas.Fr),
|
|
95
95
|
tokenSalt: schemas.Fr,
|
|
@@ -117,6 +117,9 @@ export const BotConfigSchema = z
|
|
|
117
117
|
senderSalt: undefined,
|
|
118
118
|
l2GasLimit: undefined,
|
|
119
119
|
daGasLimit: undefined,
|
|
120
|
+
l1Mnemonic: undefined,
|
|
121
|
+
l1PrivateKey: undefined,
|
|
122
|
+
senderPrivateKey: undefined,
|
|
120
123
|
...config,
|
|
121
124
|
})) satisfies ZodFor<BotConfig>;
|
|
122
125
|
|
|
@@ -166,6 +169,7 @@ export const botConfigMappings: ConfigMappingsType<BotConfig> = {
|
|
|
166
169
|
recipientEncryptionSecret: {
|
|
167
170
|
env: 'BOT_RECIPIENT_ENCRYPTION_SECRET',
|
|
168
171
|
description: 'Encryption secret for a recipient account.',
|
|
172
|
+
printDefault: sv => sv?.getValue(),
|
|
169
173
|
...secretFrConfigHelper(Fr.fromHexString('0xcafecafe')),
|
|
170
174
|
},
|
|
171
175
|
tokenSalt: {
|
package/src/factory.ts
CHANGED
|
@@ -124,7 +124,7 @@ export class BotFactory {
|
|
|
124
124
|
* @returns The sender wallet.
|
|
125
125
|
*/
|
|
126
126
|
private async setupAccount() {
|
|
127
|
-
const privateKey = this.config.senderPrivateKey
|
|
127
|
+
const privateKey = this.config.senderPrivateKey?.getValue();
|
|
128
128
|
if (privateKey) {
|
|
129
129
|
return await this.setupAccountWithPrivateKey(privateKey);
|
|
130
130
|
} else {
|