@aztec/bot 3.0.0-canary.a9708bd → 3.0.0-devnet.20251212

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.
Files changed (46) hide show
  1. package/dest/amm_bot.d.ts +9 -9
  2. package/dest/amm_bot.d.ts.map +1 -1
  3. package/dest/amm_bot.js +23 -20
  4. package/dest/base_bot.d.ts +11 -8
  5. package/dest/base_bot.d.ts.map +1 -1
  6. package/dest/base_bot.js +18 -18
  7. package/dest/bot.d.ts +8 -9
  8. package/dest/bot.d.ts.map +1 -1
  9. package/dest/bot.js +11 -12
  10. package/dest/config.d.ts +58 -54
  11. package/dest/config.d.ts.map +1 -1
  12. package/dest/config.js +30 -24
  13. package/dest/factory.d.ts +14 -32
  14. package/dest/factory.d.ts.map +1 -1
  15. package/dest/factory.js +129 -115
  16. package/dest/index.d.ts +2 -1
  17. package/dest/index.d.ts.map +1 -1
  18. package/dest/index.js +1 -0
  19. package/dest/interface.d.ts +2 -2
  20. package/dest/interface.d.ts.map +1 -1
  21. package/dest/interface.js +1 -1
  22. package/dest/rpc.d.ts +1 -1
  23. package/dest/runner.d.ts +12 -13
  24. package/dest/runner.d.ts.map +1 -1
  25. package/dest/runner.js +18 -32
  26. package/dest/store/bot_store.d.ts +44 -0
  27. package/dest/store/bot_store.d.ts.map +1 -0
  28. package/dest/store/bot_store.js +107 -0
  29. package/dest/store/index.d.ts +2 -0
  30. package/dest/store/index.d.ts.map +1 -0
  31. package/dest/store/index.js +1 -0
  32. package/dest/utils.d.ts +4 -4
  33. package/dest/utils.d.ts.map +1 -1
  34. package/dest/utils.js +5 -5
  35. package/package.json +16 -13
  36. package/src/amm_bot.ts +39 -31
  37. package/src/base_bot.ts +24 -22
  38. package/src/bot.ts +25 -14
  39. package/src/config.ts +32 -30
  40. package/src/factory.ts +162 -157
  41. package/src/index.ts +1 -0
  42. package/src/interface.ts +1 -1
  43. package/src/runner.ts +19 -23
  44. package/src/store/bot_store.ts +141 -0
  45. package/src/store/index.ts +1 -0
  46. package/src/utils.ts +10 -5
package/dest/config.js CHANGED
@@ -1,7 +1,8 @@
1
- import { booleanConfigHelper, getConfigFromMappings, getDefaultConfig, numberConfigHelper, optionalNumberConfigHelper, secretFrConfigHelper, secretStringConfigHelper } from '@aztec/foundation/config';
2
- import { Fr } from '@aztec/foundation/fields';
1
+ import { booleanConfigHelper, getConfigFromMappings, getDefaultConfig, numberConfigHelper, optionalNumberConfigHelper, pickConfigMappings, secretFrConfigHelper, secretStringConfigHelper } from '@aztec/foundation/config';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
+ import { dataConfigMappings } from '@aztec/kv-store/config';
3
4
  import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
4
- import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
5
+ import { protocolContractsHash } from '@aztec/protocol-contracts';
5
6
  import { schemas } from '@aztec/stdlib/schemas';
6
7
  import { z } from 'zod';
7
8
  const BotFollowChain = [
@@ -17,19 +18,18 @@ export var SupportedTokenContracts = /*#__PURE__*/ function(SupportedTokenContra
17
18
  export const BotConfigSchema = z.object({
18
19
  nodeUrl: z.string().optional(),
19
20
  nodeAdminUrl: z.string().optional(),
20
- pxeUrl: z.string().optional(),
21
21
  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
- recipientEncryptionSecret: schemas.SecretValue(schemas.Fr),
28
27
  tokenSalt: schemas.Fr,
29
28
  txIntervalSeconds: z.number(),
30
29
  privateTransfersPerTx: z.number().int().nonnegative(),
31
30
  publicTransfersPerTx: z.number().int().nonnegative(),
32
31
  feePaymentMethod: z.literal('fee_juice'),
32
+ baseFeePadding: z.number().int().nonnegative(),
33
33
  noStart: z.boolean(),
34
34
  txMinedWaitSeconds: z.number(),
35
35
  followChain: z.enum(BotFollowChain),
@@ -40,15 +40,21 @@ export const BotConfigSchema = z.object({
40
40
  contract: z.nativeEnum(SupportedTokenContracts),
41
41
  maxConsecutiveErrors: z.number().int().nonnegative(),
42
42
  stopWhenUnhealthy: z.boolean(),
43
- ammTxs: z.boolean().default(false)
43
+ ammTxs: z.boolean().default(false),
44
+ dataDirectory: z.string().optional(),
45
+ dataStoreMapSizeKb: z.number().optional()
44
46
  }).transform((config)=>({
45
47
  nodeUrl: undefined,
46
48
  nodeAdminUrl: undefined,
47
- pxeUrl: undefined,
48
49
  l1RpcUrls: undefined,
49
50
  senderSalt: undefined,
50
51
  l2GasLimit: undefined,
51
52
  daGasLimit: undefined,
53
+ l1Mnemonic: undefined,
54
+ l1PrivateKey: undefined,
55
+ senderPrivateKey: undefined,
56
+ dataDirectory: undefined,
57
+ dataStoreMapSizeKb: 1_024 * 1_024,
52
58
  ...config
53
59
  }));
54
60
  export const botConfigMappings = {
@@ -60,10 +66,6 @@ export const botConfigMappings = {
60
66
  env: 'AZTEC_NODE_ADMIN_URL',
61
67
  description: 'The URL to the Aztec node admin API to force-flush txs if configured.'
62
68
  },
63
- pxeUrl: {
64
- env: 'BOT_PXE_URL',
65
- description: 'URL to the PXE for sending txs, or undefined if an in-proc PXE is used.'
66
- },
67
69
  l1RpcUrls: {
68
70
  env: 'ETHEREUM_HOSTS',
69
71
  description: 'URL of the ethereum host.',
@@ -82,7 +84,7 @@ export const botConfigMappings = {
82
84
  l1ToL2MessageTimeoutSeconds: {
83
85
  env: 'BOT_L1_TO_L2_TIMEOUT_SECONDS',
84
86
  description: 'How long to wait for L1 to L2 messages to become available on L2',
85
- ...numberConfigHelper(60)
87
+ ...numberConfigHelper(3600)
86
88
  },
87
89
  senderPrivateKey: {
88
90
  env: 'BOT_PRIVATE_KEY',
@@ -91,17 +93,12 @@ export const botConfigMappings = {
91
93
  },
92
94
  senderSalt: {
93
95
  env: 'BOT_ACCOUNT_SALT',
94
- description: 'The salt to use to deploys the sender account.',
96
+ description: 'The salt to use to deploy the sender account.',
95
97
  parseEnv: (val)=>val ? Fr.fromHexString(val) : undefined
96
98
  },
97
- recipientEncryptionSecret: {
98
- env: 'BOT_RECIPIENT_ENCRYPTION_SECRET',
99
- description: 'Encryption secret for a recipient account.',
100
- ...secretFrConfigHelper(Fr.fromHexString('0xcafecafe'))
101
- },
102
99
  tokenSalt: {
103
100
  env: 'BOT_TOKEN_SALT',
104
- description: 'Salt for the token contract deployment.',
101
+ description: 'The salt to use to deploy the token contract.',
105
102
  parseEnv: (val)=>Fr.fromHexString(val),
106
103
  defaultValue: Fr.fromHexString('1')
107
104
  },
@@ -126,6 +123,11 @@ export const botConfigMappings = {
126
123
  parseEnv: (val)=>val || undefined,
127
124
  defaultValue: 'fee_juice'
128
125
  },
126
+ baseFeePadding: {
127
+ env: 'BOT_BASE_FEE_PADDING',
128
+ description: 'How much is the bot willing to overpay vs. the current base fee',
129
+ ...numberConfigHelper(3)
130
+ },
129
131
  noStart: {
130
132
  env: 'BOT_NO_START',
131
133
  description: 'True to not automatically setup or start the bot on initialization.',
@@ -192,7 +194,11 @@ export const botConfigMappings = {
192
194
  env: 'BOT_AMM_TXS',
193
195
  description: 'Deploy an AMM and send swaps to it',
194
196
  ...booleanConfigHelper(false)
195
- }
197
+ },
198
+ ...pickConfigMappings(dataConfigMappings, [
199
+ 'dataStoreMapSizeKb',
200
+ 'dataDirectory'
201
+ ])
196
202
  };
197
203
  export function getBotConfigFromEnv() {
198
204
  return getConfigFromMappings(botConfigMappings);
@@ -202,7 +208,7 @@ export function getBotDefaultConfig() {
202
208
  }
203
209
  export function getVersions() {
204
210
  return {
205
- l2ProtocolContractsTreeRoot: protocolContractTreeRoot.toString(),
211
+ l2ProtocolContractsHash: protocolContractsHash.toString(),
206
212
  l2CircuitsVkTreeRoot: getVKTreeRoot().toString()
207
213
  };
208
214
  }
package/dest/factory.d.ts CHANGED
@@ -1,55 +1,41 @@
1
- import { AztecAddress, type PXE } from '@aztec/aztec.js';
1
+ import { AztecAddress } from '@aztec/aztec.js/addresses';
2
2
  import { AMMContract } from '@aztec/noir-contracts.js/AMM';
3
3
  import { PrivateTokenContract } from '@aztec/noir-contracts.js/PrivateToken';
4
4
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
5
5
  import type { AztecNode, AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
6
+ import { TestWallet } from '@aztec/test-wallet/server';
6
7
  import { type BotConfig } from './config.js';
8
+ import type { BotStore } from './store/index.js';
7
9
  export declare class BotFactory {
8
10
  private readonly config;
9
- private pxe;
10
- private node?;
11
- private nodeAdmin?;
11
+ private readonly wallet;
12
+ private readonly store;
13
+ private readonly aztecNode;
14
+ private readonly aztecNodeAdmin?;
12
15
  private log;
13
- constructor(config: BotConfig, dependencies: {
14
- pxe?: PXE;
15
- nodeAdmin?: AztecNodeAdmin;
16
- node?: AztecNode;
17
- });
16
+ constructor(config: BotConfig, wallet: TestWallet, store: BotStore, aztecNode: AztecNode, aztecNodeAdmin?: AztecNodeAdmin | undefined);
18
17
  /**
19
18
  * Initializes a new bot by setting up the sender account, registering the recipient,
20
19
  * deploying the token contract, and minting tokens if necessary.
21
20
  */
22
21
  setup(): Promise<{
23
- wallet: import("@aztec/aztec.js").AccountWalletWithSecretKey;
22
+ wallet: TestWallet;
24
23
  defaultAccountAddress: AztecAddress;
25
24
  token: TokenContract | PrivateTokenContract;
26
- pxe: PXE;
25
+ node: AztecNode;
27
26
  recipient: AztecAddress;
28
27
  }>;
29
28
  setupAmm(): Promise<{
30
- wallet: import("@aztec/aztec.js").AccountWalletWithSecretKey;
29
+ wallet: TestWallet;
31
30
  defaultAccountAddress: AztecAddress;
32
31
  amm: AMMContract;
33
32
  token0: TokenContract;
34
33
  token1: TokenContract;
35
- pxe: PXE;
34
+ node: AztecNode;
36
35
  }>;
37
- /**
38
- * Checks if the sender account contract is initialized, and initializes it if necessary.
39
- * @returns The sender wallet.
40
- */
41
36
  private setupAccount;
42
37
  private setupAccountWithPrivateKey;
43
38
  private setupTestAccount;
44
- /**
45
- * Registers the recipient for txs in the pxe.
46
- */
47
- private registerRecipient;
48
- /**
49
- * Checks if the token contract is deployed and deploys it if necessary.
50
- * @param wallet - Wallet to deploy the token contract from.
51
- * @returns The TokenContract instance.
52
- */
53
39
  private setupToken;
54
40
  /**
55
41
  * Checks if the token contract is deployed and deploys it if necessary.
@@ -60,13 +46,9 @@ export declare class BotFactory {
60
46
  private setupAmmContract;
61
47
  private fundAmm;
62
48
  private registerOrDeployContract;
63
- /**
64
- * Mints private and public tokens for the sender if their balance is below the minimum.
65
- * @param token - Token contract.
66
- */
67
49
  private mintTokens;
50
+ private getOrCreateBridgeClaim;
68
51
  private bridgeL1FeeJuice;
69
52
  private withNoMinTxsPerBlock;
70
- private advanceL2Block;
71
53
  }
72
- //# sourceMappingURL=factory.d.ts.map
54
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFjdG9yeS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2ZhY3RvcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBaUJ6RCxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sOEJBQThCLENBQUM7QUFDM0QsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sdUNBQXVDLENBQUM7QUFDN0UsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBRS9ELE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxjQUFjLEVB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C9C;IAEJ;;;OAGG;IACU,KAAK,IAAI,OAAO,CAAC;QAC5B,MAAM,EAAE,UAAU,CAAC;QACnB,qBAAqB,EAAE,YAAY,CAAC;QACpC,KAAK,EAAE,aAAa,GAAG,oBAAoB,CAAC;QAC5C,IAAI,EAAE,SAAS,CAAC;QAChB,SAAS,EAAE,YAAY,CAAC;KACzB,CAAC,CAMD;IAEY,QAAQ,IAAI,OAAO,CAAC;QAC/B,MAAM,EAAE,UAAU,CAAC;QACnB,qBAAqB,EAAE,YAAY,CAAC;QACpC,GAAG,EAAE,WAAW,CAAC;QACjB,MAAM,EAAE,aAAa,CAAC;QACtB,MAAM,EAAE,aAAa,CAAC;QACtB,IAAI,EAAE,SAAS,CAAC;KACjB,CAAC,CAsBD;YAMa,YAAY;YAWZ,0BAA0B;YAwC1B,gBAAgB;YAgBhB,UAAU;IA+BxB;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;YAYZ,gBAAgB;YAoBhB,OAAO;YA8EP,wBAAwB;YAsBxB,UAAU;YAwCV,sBAAsB;YA4BtB,gBAAgB;YAgChB,oBAAoB;CAenC"}
package/dest/factory.js CHANGED
@@ -1,153 +1,145 @@
1
- import { getSchnorrAccount } from '@aztec/accounts/schnorr';
2
- import { getDeployedTestAccountsWallets, getInitialTestAccounts } from '@aztec/accounts/testing';
3
- import { BatchCall, FeeJuicePaymentMethodWithClaim, L1FeeJuicePortalManager, createLogger, createPXEClient, retryUntil } from '@aztec/aztec.js';
4
- import { createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
5
- import { Fr } from '@aztec/foundation/fields';
1
+ import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
2
+ import { getInitialTestAccountsData } from '@aztec/accounts/testing';
3
+ import { AztecAddress } from '@aztec/aztec.js/addresses';
4
+ import { BatchCall } from '@aztec/aztec.js/contracts';
5
+ import { L1FeeJuicePortalManager } from '@aztec/aztec.js/ethereum';
6
+ import { FeeJuicePaymentMethodWithClaim } from '@aztec/aztec.js/fee';
7
+ import { createLogger } from '@aztec/aztec.js/log';
8
+ import { waitForL1ToL2MessageReady } from '@aztec/aztec.js/messaging';
9
+ import { createEthereumChain } from '@aztec/ethereum/chain';
10
+ import { createExtendedL1Client } from '@aztec/ethereum/client';
11
+ import { Fr } from '@aztec/foundation/curves/bn254';
6
12
  import { Timer } from '@aztec/foundation/timer';
7
13
  import { AMMContract } from '@aztec/noir-contracts.js/AMM';
8
14
  import { PrivateTokenContract } from '@aztec/noir-contracts.js/PrivateToken';
9
15
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
16
+ import { GasSettings } from '@aztec/stdlib/gas';
10
17
  import { deriveSigningKey } from '@aztec/stdlib/keys';
11
- import { makeTracedFetch } from '@aztec/telemetry-client';
12
- import { SupportedTokenContracts, getVersions } from './config.js';
18
+ import { SupportedTokenContracts } from './config.js';
13
19
  import { getBalances, getPrivateBalance, isStandardTokenContract } from './utils.js';
14
20
  const MINT_BALANCE = 1e12;
15
21
  const MIN_BALANCE = 1e3;
16
22
  export class BotFactory {
17
23
  config;
18
- pxe;
19
- node;
20
- nodeAdmin;
24
+ wallet;
25
+ store;
26
+ aztecNode;
27
+ aztecNodeAdmin;
21
28
  log;
22
- constructor(config, dependencies){
29
+ constructor(config, wallet, store, aztecNode, aztecNodeAdmin){
23
30
  this.config = config;
31
+ this.wallet = wallet;
32
+ this.store = store;
33
+ this.aztecNode = aztecNode;
34
+ this.aztecNodeAdmin = aztecNodeAdmin;
24
35
  this.log = createLogger('bot');
25
- if (config.flushSetupTransactions && !dependencies.nodeAdmin) {
26
- throw new Error(`Either a node admin client or node admin url must be provided if transaction flushing is requested`);
27
- }
28
- if (config.senderPrivateKey && config.senderPrivateKey.getValue() && !dependencies.node) {
29
- throw new Error(`Either a node client or node url must be provided for bridging L1 fee juice to deploy an account with private key`);
30
- }
31
- if (!dependencies.pxe && !config.pxeUrl) {
32
- throw new Error(`Either a PXE client or a PXE URL must be provided`);
33
- }
34
- this.node = dependencies.node;
35
- this.nodeAdmin = dependencies.nodeAdmin;
36
- if (dependencies.pxe) {
37
- this.log.info(`Using local PXE`);
38
- this.pxe = dependencies.pxe;
39
- return;
40
- }
41
- this.log.info(`Using remote PXE at ${config.pxeUrl}`);
42
- this.pxe = createPXEClient(config.pxeUrl, getVersions(), makeTracedFetch([
43
- 1,
44
- 2,
45
- 3
46
- ], false));
47
36
  }
48
37
  /**
49
38
  * Initializes a new bot by setting up the sender account, registering the recipient,
50
39
  * deploying the token contract, and minting tokens if necessary.
51
40
  */ async setup() {
52
- const recipient = await this.registerRecipient();
53
- const wallet = await this.setupAccount();
54
- const defaultAccountAddress = wallet.getAddress();
55
- const token = await this.setupToken(wallet, defaultAccountAddress);
41
+ const recipient = (await this.wallet.createAccount()).address;
42
+ const defaultAccountAddress = await this.setupAccount();
43
+ const token = await this.setupToken(defaultAccountAddress);
56
44
  await this.mintTokens(token, defaultAccountAddress);
57
45
  return {
58
- wallet,
46
+ wallet: this.wallet,
59
47
  defaultAccountAddress,
60
48
  token,
61
- pxe: this.pxe,
49
+ node: this.aztecNode,
62
50
  recipient
63
51
  };
64
52
  }
65
53
  async setupAmm() {
66
- const wallet = await this.setupAccount();
67
- const defaultAccountAddress = wallet.getAddress();
68
- const token0 = await this.setupTokenContract(wallet, wallet.getAddress(), this.config.tokenSalt, 'BotToken0', 'BOT0');
69
- const token1 = await this.setupTokenContract(wallet, wallet.getAddress(), this.config.tokenSalt, 'BotToken1', 'BOT1');
70
- const liquidityToken = await this.setupTokenContract(wallet, wallet.getAddress(), this.config.tokenSalt, 'BotLPToken', 'BOTLP');
71
- const amm = await this.setupAmmContract(wallet, wallet.getAddress(), this.config.tokenSalt, token0, token1, liquidityToken);
72
- await this.fundAmm(wallet, wallet.getAddress(), amm, token0, token1, liquidityToken);
54
+ const defaultAccountAddress = await this.setupAccount();
55
+ const token0 = await this.setupTokenContract(defaultAccountAddress, this.config.tokenSalt, 'BotToken0', 'BOT0');
56
+ const token1 = await this.setupTokenContract(defaultAccountAddress, this.config.tokenSalt, 'BotToken1', 'BOT1');
57
+ const liquidityToken = await this.setupTokenContract(defaultAccountAddress, this.config.tokenSalt, 'BotLPToken', 'BOTLP');
58
+ const amm = await this.setupAmmContract(defaultAccountAddress, this.config.tokenSalt, token0, token1, liquidityToken);
59
+ await this.fundAmm(defaultAccountAddress, defaultAccountAddress, amm, token0, token1, liquidityToken);
73
60
  this.log.info(`AMM initialized and funded`);
74
61
  return {
75
- wallet,
62
+ wallet: this.wallet,
76
63
  defaultAccountAddress,
77
64
  amm,
78
65
  token0,
79
66
  token1,
80
- pxe: this.pxe
67
+ node: this.aztecNode
81
68
  };
82
69
  }
83
70
  /**
84
71
  * Checks if the sender account contract is initialized, and initializes it if necessary.
85
72
  * @returns The sender wallet.
86
73
  */ async setupAccount() {
87
- const privateKey = this.config.senderPrivateKey.getValue();
74
+ const privateKey = this.config.senderPrivateKey?.getValue();
88
75
  if (privateKey) {
76
+ this.log.info(`Setting up account with provided private key`);
89
77
  return await this.setupAccountWithPrivateKey(privateKey);
90
78
  } else {
79
+ this.log.info(`Setting up test account`);
91
80
  return await this.setupTestAccount();
92
81
  }
93
82
  }
94
- async setupAccountWithPrivateKey(privateKey) {
83
+ async setupAccountWithPrivateKey(secret) {
95
84
  const salt = this.config.senderSalt ?? Fr.ONE;
96
- const signingKey = deriveSigningKey(privateKey);
97
- const account = await getSchnorrAccount(this.pxe, privateKey, signingKey, salt);
98
- const isInit = (await this.pxe.getContractMetadata(account.getAddress())).isContractInitialized;
85
+ const signingKey = deriveSigningKey(secret);
86
+ const accountData = {
87
+ secret,
88
+ salt,
89
+ contract: new SchnorrAccountContract(signingKey)
90
+ };
91
+ const accountManager = await this.wallet.createAccount(accountData);
92
+ const isInit = (await this.wallet.getContractMetadata(accountManager.address)).isContractInitialized;
99
93
  if (isInit) {
100
- this.log.info(`Account at ${account.getAddress().toString()} already initialized`);
94
+ this.log.info(`Account at ${accountManager.address.toString()} already initialized`);
101
95
  const timer = new Timer();
102
- const wallet = await account.register();
103
- this.log.info(`Account at ${account.getAddress()} registered. duration=${timer.ms()}`);
104
- return wallet;
96
+ const address = accountManager.address;
97
+ this.log.info(`Account at ${address} registered. duration=${timer.ms()}`);
98
+ await this.store.deleteBridgeClaim(address);
99
+ return address;
105
100
  } else {
106
- const address = account.getAddress();
101
+ const address = accountManager.address;
107
102
  this.log.info(`Deploying account at ${address}`);
108
- const claim = await this.bridgeL1FeeJuice(address);
109
- // docs:start:claim_and_deploy
110
- const wallet = await account.getWallet();
111
- const paymentMethod = new FeeJuicePaymentMethodWithClaim(wallet, claim);
112
- const sentTx = account.deploy({
103
+ const claim = await this.getOrCreateBridgeClaim(address);
104
+ const paymentMethod = new FeeJuicePaymentMethodWithClaim(accountManager.address, claim);
105
+ const deployMethod = await accountManager.getDeployMethod();
106
+ const maxFeesPerGas = (await this.aztecNode.getCurrentBaseFees()).mul(1 + this.config.baseFeePadding);
107
+ const gasSettings = GasSettings.default({
108
+ maxFeesPerGas
109
+ });
110
+ const sentTx = deployMethod.send({
111
+ from: AztecAddress.ZERO,
113
112
  fee: {
113
+ gasSettings,
114
114
  paymentMethod
115
115
  }
116
116
  });
117
117
  const txHash = await sentTx.getTxHash();
118
- // docs:end:claim_and_deploy
119
118
  this.log.info(`Sent tx for account deployment with hash ${txHash.toString()}`);
120
119
  await this.withNoMinTxsPerBlock(()=>sentTx.wait({
121
120
  timeout: this.config.txMinedWaitSeconds
122
121
  }));
123
122
  this.log.info(`Account deployed at ${address}`);
124
- return wallet;
123
+ // Clean up the consumed bridge claim
124
+ await this.store.deleteBridgeClaim(address);
125
+ return accountManager.address;
125
126
  }
126
127
  }
127
128
  async setupTestAccount() {
128
- let [wallet] = await getDeployedTestAccountsWallets(this.pxe);
129
- if (wallet) {
130
- this.log.info(`Using funded test account: ${wallet.getAddress()}`);
131
- } else {
132
- this.log.info('Registering funded test account');
133
- const [account] = await getInitialTestAccounts();
134
- const manager = await getSchnorrAccount(this.pxe, account.secret, account.signingKey, account.salt);
135
- wallet = await manager.register();
136
- this.log.info(`Funded test account registered: ${wallet.getAddress()}`);
137
- }
138
- return wallet;
139
- }
140
- /**
141
- * Registers the recipient for txs in the pxe.
142
- */ async registerRecipient() {
143
- const recipient = await this.pxe.registerAccount(this.config.recipientEncryptionSecret.getValue(), Fr.ONE);
144
- return recipient.address;
129
+ const [initialAccountData] = await getInitialTestAccountsData();
130
+ const accountData = {
131
+ secret: initialAccountData.secret,
132
+ salt: initialAccountData.salt,
133
+ contract: new SchnorrAccountContract(initialAccountData.signingKey)
134
+ };
135
+ const accountManager = await this.wallet.createAccount(accountData);
136
+ return accountManager.address;
145
137
  }
146
138
  /**
147
139
  * Checks if the token contract is deployed and deploys it if necessary.
148
140
  * @param wallet - Wallet to deploy the token contract from.
149
141
  * @returns The TokenContract instance.
150
- */ async setupToken(wallet, sender) {
142
+ */ async setupToken(sender) {
151
143
  let deploy;
152
144
  const deployOpts = {
153
145
  from: sender,
@@ -155,9 +147,9 @@ export class BotFactory {
155
147
  universalDeploy: true
156
148
  };
157
149
  if (this.config.contract === SupportedTokenContracts.TokenContract) {
158
- deploy = TokenContract.deploy(wallet, sender, 'BotToken', 'BOT', 18);
150
+ deploy = TokenContract.deploy(this.wallet, sender, 'BotToken', 'BOT', 18);
159
151
  } else if (this.config.contract === SupportedTokenContracts.PrivateTokenContract) {
160
- deploy = PrivateTokenContract.deploy(wallet, MINT_BALANCE, sender);
152
+ deploy = PrivateTokenContract.deploy(this.wallet, MINT_BALANCE, sender);
161
153
  deployOpts.skipInstancePublication = true;
162
154
  deployOpts.skipClassPublication = true;
163
155
  deployOpts.skipInitialization = false;
@@ -165,7 +157,7 @@ export class BotFactory {
165
157
  throw new Error(`Unsupported token contract type: ${this.config.contract}`);
166
158
  }
167
159
  const address = (await deploy.getInstance(deployOpts)).address;
168
- if ((await this.pxe.getContractMetadata(address)).isContractPublished) {
160
+ if ((await this.wallet.getContractMetadata(address)).isContractPublished) {
169
161
  this.log.info(`Token at ${address.toString()} already deployed`);
170
162
  return deploy.register();
171
163
  } else {
@@ -182,22 +174,22 @@ export class BotFactory {
182
174
  * Checks if the token contract is deployed and deploys it if necessary.
183
175
  * @param wallet - Wallet to deploy the token contract from.
184
176
  * @returns The TokenContract instance.
185
- */ setupTokenContract(wallet, deployer, contractAddressSalt, name, ticker, decimals = 18) {
177
+ */ setupTokenContract(deployer, contractAddressSalt, name, ticker, decimals = 18) {
186
178
  const deployOpts = {
187
179
  from: deployer,
188
180
  contractAddressSalt,
189
181
  universalDeploy: true
190
182
  };
191
- const deploy = TokenContract.deploy(wallet, deployer, name, ticker, decimals);
183
+ const deploy = TokenContract.deploy(this.wallet, deployer, name, ticker, decimals);
192
184
  return this.registerOrDeployContract('Token - ' + name, deploy, deployOpts);
193
185
  }
194
- async setupAmmContract(wallet, deployer, contractAddressSalt, token0, token1, lpToken) {
186
+ async setupAmmContract(deployer, contractAddressSalt, token0, token1, lpToken) {
195
187
  const deployOpts = {
196
188
  from: deployer,
197
189
  contractAddressSalt,
198
190
  universalDeploy: true
199
191
  };
200
- const deploy = AMMContract.deploy(wallet, token0.address, token1.address, lpToken.address);
192
+ const deploy = AMMContract.deploy(this.wallet, token0.address, token1.address, lpToken.address);
201
193
  const amm = await this.registerOrDeployContract('AMM', deploy, deployOpts);
202
194
  this.log.info(`AMM deployed at ${amm.address}`);
203
195
  const minterTx = lpToken.methods.set_minter(amm.address, true).send({
@@ -210,7 +202,7 @@ export class BotFactory {
210
202
  this.log.info(`Liquidity token initialized`);
211
203
  return amm;
212
204
  }
213
- async fundAmm(wallet, liquidityProvider, amm, token0, token1, lpToken) {
205
+ async fundAmm(defaultAccountAddress, liquidityProvider, amm, token0, token1, lpToken) {
214
206
  const getPrivateBalances = ()=>Promise.all([
215
207
  token0.methods.balance_of_private(liquidityProvider).simulate({
216
208
  from: liquidityProvider
@@ -231,15 +223,15 @@ export class BotFactory {
231
223
  const [t0Bal, t1Bal, lpBal] = await getPrivateBalances();
232
224
  this.log.info(`Minting ${MINT_BALANCE} tokens of each BotToken0 and BotToken1. Current private balances of ${liquidityProvider}: token0=${t0Bal}, token1=${t1Bal}, lp=${lpBal}`);
233
225
  // Add authwitnesses for the transfers in AMM::add_liquidity function
234
- const token0Authwit = await wallet.createAuthWit({
226
+ const token0Authwit = await this.wallet.createAuthWit(defaultAccountAddress, {
235
227
  caller: amm.address,
236
- action: token0.methods.transfer_to_public_and_prepare_private_balance_increase(liquidityProvider, amm.address, amount0Max, authwitNonce)
228
+ call: await token0.methods.transfer_to_public_and_prepare_private_balance_increase(liquidityProvider, amm.address, amount0Max, authwitNonce).getFunctionCall()
237
229
  });
238
- const token1Authwit = await wallet.createAuthWit({
230
+ const token1Authwit = await this.wallet.createAuthWit(defaultAccountAddress, {
239
231
  caller: amm.address,
240
- action: token1.methods.transfer_to_public_and_prepare_private_balance_increase(liquidityProvider, amm.address, amount1Max, authwitNonce)
232
+ call: await token1.methods.transfer_to_public_and_prepare_private_balance_increase(liquidityProvider, amm.address, amount1Max, authwitNonce).getFunctionCall()
241
233
  });
242
- const mintTx = new BatchCall(wallet, [
234
+ const mintTx = new BatchCall(this.wallet, [
243
235
  token0.methods.mint_to_private(liquidityProvider, MINT_BALANCE),
244
236
  token1.methods.mint_to_private(liquidityProvider, MINT_BALANCE)
245
237
  ]).send({
@@ -262,11 +254,11 @@ export class BotFactory {
262
254
  });
263
255
  this.log.info(`Liquidity added`);
264
256
  const [newT0Bal, newT1Bal, newLPBal] = await getPrivateBalances();
265
- this.log.info(`Updated private balances of ${wallet.getAddress()} after minting and funding AMM: token0=${newT0Bal}, token1=${newT1Bal}, lp=${newLPBal}`);
257
+ this.log.info(`Updated private balances of ${defaultAccountAddress} after minting and funding AMM: token0=${newT0Bal}, token1=${newT1Bal}, lp=${newLPBal}`);
266
258
  }
267
259
  async registerOrDeployContract(name, deploy, deployOpts) {
268
260
  const address = (await deploy.getInstance(deployOpts)).address;
269
- if ((await this.pxe.getContractMetadata(address)).isContractPublished) {
261
+ if ((await this.wallet.getContractMetadata(address)).isContractPublished) {
270
262
  this.log.info(`Contract ${name} at ${address.toString()} already deployed`);
271
263
  return deploy.register();
272
264
  } else {
@@ -313,6 +305,32 @@ export class BotFactory {
313
305
  timeout: this.config.txMinedWaitSeconds
314
306
  }));
315
307
  }
308
+ /**
309
+ * Gets or creates a bridge claim for the recipient.
310
+ * Checks if a claim already exists in the store and reuses it if valid.
311
+ * Only creates a new bridge if fee juice balance is below threshold.
312
+ */ async getOrCreateBridgeClaim(recipient) {
313
+ // Check if we have an existing claim in the store
314
+ const existingClaim = await this.store.getBridgeClaim(recipient);
315
+ if (existingClaim) {
316
+ this.log.info(`Found existing bridge claim for ${recipient.toString()}, checking validity...`);
317
+ // Check if the message is ready on L2
318
+ try {
319
+ const messageHash = Fr.fromHexString(existingClaim.claim.messageHash);
320
+ await this.withNoMinTxsPerBlock(()=>waitForL1ToL2MessageReady(this.aztecNode, messageHash, {
321
+ timeoutSeconds: this.config.l1ToL2MessageTimeoutSeconds,
322
+ forPublicConsumption: false
323
+ }));
324
+ return existingClaim.claim;
325
+ } catch (err) {
326
+ this.log.warn(`Failed to verify existing claim, creating new one: ${err}`);
327
+ await this.store.deleteBridgeClaim(recipient);
328
+ }
329
+ }
330
+ const claim = await this.bridgeL1FeeJuice(recipient);
331
+ await this.store.saveBridgeClaim(recipient, claim);
332
+ return claim;
333
+ }
316
334
  async bridgeL1FeeJuice(recipient) {
317
335
  const l1RpcUrls = this.config.l1RpcUrls;
318
336
  if (!l1RpcUrls?.length) {
@@ -322,40 +340,36 @@ export class BotFactory {
322
340
  if (!mnemonicOrPrivateKey) {
323
341
  throw new Error('Either a mnemonic or private key of an L1 account is required to bridge the fee juice to fund the deployment of the account.');
324
342
  }
325
- const { l1ChainId } = await this.pxe.getNodeInfo();
343
+ const { l1ChainId } = await this.aztecNode.getNodeInfo();
326
344
  const chain = createEthereumChain(l1RpcUrls, l1ChainId);
327
345
  const extendedClient = createExtendedL1Client(chain.rpcUrls, mnemonicOrPrivateKey, chain.chainInfo);
328
- const portal = await L1FeeJuicePortalManager.new(this.pxe, extendedClient, this.log);
346
+ const portal = await L1FeeJuicePortalManager.new(this.aztecNode, extendedClient, this.log);
329
347
  const mintAmount = await portal.getTokenManager().getMintAmount();
330
348
  const claim = await portal.bridgeTokensPublic(recipient, mintAmount, true);
331
- const isSynced = async ()=>await this.pxe.isL1ToL2MessageSynced(Fr.fromHexString(claim.messageHash));
332
- await retryUntil(isSynced, `message ${claim.messageHash} sync`, this.config.l1ToL2MessageTimeoutSeconds, 1);
349
+ await this.withNoMinTxsPerBlock(()=>waitForL1ToL2MessageReady(this.aztecNode, Fr.fromHexString(claim.messageHash), {
350
+ timeoutSeconds: this.config.l1ToL2MessageTimeoutSeconds,
351
+ forPublicConsumption: false
352
+ }));
333
353
  this.log.info(`Created a claim for ${mintAmount} L1 fee juice to ${recipient}.`, claim);
334
- // Progress by 2 L2 blocks so that the l1ToL2Message added above will be available to use on L2.
335
- await this.advanceL2Block();
336
- await this.advanceL2Block();
337
354
  return claim;
338
355
  }
339
356
  async withNoMinTxsPerBlock(fn) {
340
- if (!this.nodeAdmin || !this.config.flushSetupTransactions) {
357
+ if (!this.aztecNodeAdmin || !this.config.flushSetupTransactions) {
358
+ this.log.verbose(`No node admin client or flushing not requested (not setting minTxsPerBlock to 0)`);
341
359
  return fn();
342
360
  }
343
- const { minTxsPerBlock } = await this.nodeAdmin.getConfig();
344
- await this.nodeAdmin.setConfig({
361
+ const { minTxsPerBlock } = await this.aztecNodeAdmin.getConfig();
362
+ this.log.warn(`Setting sequencer minTxsPerBlock to 0 from ${minTxsPerBlock} to flush setup transactions`);
363
+ await this.aztecNodeAdmin.setConfig({
345
364
  minTxsPerBlock: 0
346
365
  });
347
366
  try {
348
367
  return await fn();
349
368
  } finally{
350
- await this.nodeAdmin.setConfig({
369
+ this.log.warn(`Restoring sequencer minTxsPerBlock to ${minTxsPerBlock}`);
370
+ await this.aztecNodeAdmin.setConfig({
351
371
  minTxsPerBlock
352
372
  });
353
373
  }
354
374
  }
355
- async advanceL2Block() {
356
- await this.withNoMinTxsPerBlock(async ()=>{
357
- const initialBlockNumber = await this.node.getBlockNumber();
358
- await retryUntil(async ()=>await this.node.getBlockNumber() >= initialBlockNumber + 1);
359
- });
360
- }
361
375
  }
package/dest/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  export { Bot } from './bot.js';
2
2
  export { AmmBot } from './amm_bot.js';
3
3
  export { BotRunner } from './runner.js';
4
+ export { BotStore } from './store/bot_store.js';
4
5
  export { type BotConfig, getBotConfigFromEnv, getBotDefaultConfig, botConfigMappings, SupportedTokenContracts, } from './config.js';
5
6
  export { getBotRunnerApiHandler } from './rpc.js';
6
7
  export * from './interface.js';
7
- //# sourceMappingURL=index.d.ts.map
8
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsR0FBRyxFQUFFLE1BQU0sVUFBVSxDQUFDO0FBQy9CLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxjQUFjLENBQUM7QUFDdEMsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUN4QyxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDaEQsT0FBTyxFQUNMLEtBQUssU0FBUyxFQUNkLG1CQUFtQixFQUNuQixtQkFBbUIsRUFDbkIsaUJBQWlCLEVBQ2pCLHVCQUF1QixHQUN4QixNQUFNLGFBQWEsQ0FBQztBQUNyQixPQUFPLEVBQUUsc0JBQXNCLEVBQUUsTUFBTSxVQUFVLENBQUM7QUFDbEQsY0FBYyxnQkFBZ0IsQ0FBQyJ9
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EACL,KAAK,SAAS,EACd,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EACL,KAAK,SAAS,EACd,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,cAAc,gBAAgB,CAAC"}