@aztec/bot 0.82.3 → 0.83.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.
- package/dest/base_bot.d.ts +2 -2
- package/dest/base_bot.d.ts.map +1 -1
- package/dest/base_bot.js +2 -1
- package/package.json +11 -11
- package/src/base_bot.ts +5 -2
package/dest/base_bot.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthWitness, type SendMethodOptions, SentTx, type Wallet } from '@aztec/aztec.js';
|
|
1
|
+
import { AuthWitness, type SendMethodOptions, SentTx, TxHash, TxReceipt, type Wallet } from '@aztec/aztec.js';
|
|
2
2
|
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
3
3
|
import type { BotConfig } from './config.js';
|
|
4
4
|
export declare abstract class BaseBot {
|
|
@@ -9,7 +9,7 @@ export declare abstract class BaseBot {
|
|
|
9
9
|
protected attempts: number;
|
|
10
10
|
protected successes: number;
|
|
11
11
|
protected constructor(pxe: PXE, wallet: Wallet, config: BotConfig);
|
|
12
|
-
run(): Promise<
|
|
12
|
+
run(): Promise<TxReceipt | TxHash>;
|
|
13
13
|
protected abstract createAndSendTx(logCtx: object): Promise<SentTx>;
|
|
14
14
|
protected getSendMethodOpts(...authWitnesses: AuthWitness[]): SendMethodOptions;
|
|
15
15
|
}
|
package/dest/base_bot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base_bot.d.ts","sourceRoot":"","sources":["../src/base_bot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAEX,KAAK,iBAAiB,EACtB,MAAM,EACN,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,8BAAsB,OAAO;aAMW,GAAG,EAAE,GAAG;aAAkB,MAAM,EAAE,MAAM;IAAS,MAAM,EAAE,SAAS;IALxG,SAAS,CAAC,GAAG,mCAAuB;IAEpC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAK;IAC/B,SAAS,CAAC,SAAS,EAAE,MAAM,CAAK;IAEhC,SAAS,aAA6B,GAAG,EAAE,GAAG,EAAkB,MAAM,EAAE,MAAM,EAAS,MAAM,EAAE,SAAS;IAE3F,GAAG;
|
|
1
|
+
{"version":3,"file":"base_bot.d.ts","sourceRoot":"","sources":["../src/base_bot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAEX,KAAK,iBAAiB,EACtB,MAAM,EACN,MAAM,EACN,SAAS,EACT,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,8BAAsB,OAAO;aAMW,GAAG,EAAE,GAAG;aAAkB,MAAM,EAAE,MAAM;IAAS,MAAM,EAAE,SAAS;IALxG,SAAS,CAAC,GAAG,mCAAuB;IAEpC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAK;IAC/B,SAAS,CAAC,SAAS,EAAE,MAAM,CAAK;IAEhC,SAAS,aAA6B,GAAG,EAAE,GAAG,EAAkB,MAAM,EAAE,MAAM,EAAS,MAAM,EAAE,SAAS;IAE3F,GAAG,IAAI,OAAO,CAAC,SAAS,GAAG,MAAM,CAAC;IAiC/C,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAEnE,SAAS,CAAC,iBAAiB,CAAC,GAAG,aAAa,EAAE,WAAW,EAAE,GAAG,iBAAiB;CAkBhF"}
|
package/dest/base_bot.js
CHANGED
|
@@ -26,7 +26,7 @@ export class BaseBot {
|
|
|
26
26
|
const txHash = await tx.getTxHash();
|
|
27
27
|
if (followChain === 'NONE') {
|
|
28
28
|
this.log.info(`Transaction ${txHash} sent, not waiting for it to be mined`);
|
|
29
|
-
return;
|
|
29
|
+
return txHash;
|
|
30
30
|
}
|
|
31
31
|
this.log.verbose(`Awaiting tx ${txHash} to be on the ${followChain} chain (timeout ${txMinedWaitSeconds}s)`, logCtx);
|
|
32
32
|
const receipt = await tx.wait({
|
|
@@ -39,6 +39,7 @@ export class BaseBot {
|
|
|
39
39
|
}
|
|
40
40
|
this.successes++;
|
|
41
41
|
this.log.info(`Tx #${this.attempts} ${receipt.txHash} successfully mined in block ${receipt.blockNumber} (stats: ${this.successes}/${this.attempts} success)`, logCtx);
|
|
42
|
+
return receipt;
|
|
42
43
|
}
|
|
43
44
|
getSendMethodOpts(...authWitnesses) {
|
|
44
45
|
const sender = this.wallet.getAddress();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/bot",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.83.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -52,16 +52,16 @@
|
|
|
52
52
|
]
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@aztec/accounts": "0.
|
|
56
|
-
"@aztec/aztec.js": "0.
|
|
57
|
-
"@aztec/entrypoints": "0.
|
|
58
|
-
"@aztec/ethereum": "0.
|
|
59
|
-
"@aztec/foundation": "0.
|
|
60
|
-
"@aztec/noir-contracts.js": "0.
|
|
61
|
-
"@aztec/noir-protocol-circuits-types": "0.
|
|
62
|
-
"@aztec/protocol-contracts": "0.
|
|
63
|
-
"@aztec/stdlib": "0.
|
|
64
|
-
"@aztec/telemetry-client": "0.
|
|
55
|
+
"@aztec/accounts": "0.83.0",
|
|
56
|
+
"@aztec/aztec.js": "0.83.0",
|
|
57
|
+
"@aztec/entrypoints": "0.83.0",
|
|
58
|
+
"@aztec/ethereum": "0.83.0",
|
|
59
|
+
"@aztec/foundation": "0.83.0",
|
|
60
|
+
"@aztec/noir-contracts.js": "0.83.0",
|
|
61
|
+
"@aztec/noir-protocol-circuits-types": "0.83.0",
|
|
62
|
+
"@aztec/protocol-contracts": "0.83.0",
|
|
63
|
+
"@aztec/stdlib": "0.83.0",
|
|
64
|
+
"@aztec/telemetry-client": "0.83.0",
|
|
65
65
|
"source-map-support": "^0.5.21",
|
|
66
66
|
"tslib": "^2.4.0",
|
|
67
67
|
"zod": "^3.23.8"
|
package/src/base_bot.ts
CHANGED
|
@@ -3,6 +3,8 @@ import {
|
|
|
3
3
|
FeeJuicePaymentMethod,
|
|
4
4
|
type SendMethodOptions,
|
|
5
5
|
SentTx,
|
|
6
|
+
TxHash,
|
|
7
|
+
TxReceipt,
|
|
6
8
|
type Wallet,
|
|
7
9
|
createLogger,
|
|
8
10
|
waitForProven,
|
|
@@ -20,7 +22,7 @@ export abstract class BaseBot {
|
|
|
20
22
|
|
|
21
23
|
protected constructor(public readonly pxe: PXE, public readonly wallet: Wallet, public config: BotConfig) {}
|
|
22
24
|
|
|
23
|
-
public async run() {
|
|
25
|
+
public async run(): Promise<TxReceipt | TxHash> {
|
|
24
26
|
this.attempts++;
|
|
25
27
|
const logCtx = { runId: Date.now() * 1000 + Math.floor(Math.random() * 1000) };
|
|
26
28
|
const { followChain, txMinedWaitSeconds } = this.config;
|
|
@@ -32,7 +34,7 @@ export abstract class BaseBot {
|
|
|
32
34
|
|
|
33
35
|
if (followChain === 'NONE') {
|
|
34
36
|
this.log.info(`Transaction ${txHash} sent, not waiting for it to be mined`);
|
|
35
|
-
return;
|
|
37
|
+
return txHash;
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
this.log.verbose(
|
|
@@ -50,6 +52,7 @@ export abstract class BaseBot {
|
|
|
50
52
|
`Tx #${this.attempts} ${receipt.txHash} successfully mined in block ${receipt.blockNumber} (stats: ${this.successes}/${this.attempts} success)`,
|
|
51
53
|
logCtx,
|
|
52
54
|
);
|
|
55
|
+
return receipt;
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
protected abstract createAndSendTx(logCtx: object): Promise<SentTx>;
|