@aztec/aztec.js 0.77.0-testnet-ignition.26 → 0.77.0-testnet-ignition.27

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.
@@ -25,7 +25,7 @@ export declare class DeploySentTx<TContract extends Contract = Contract> extends
25
25
  /** A getter for the deployed contract instance */
26
26
  instanceGetter: () => Promise<ContractInstanceWithAddress>;
27
27
  private log;
28
- constructor(wallet: PXE | Wallet, txHashPromise: Promise<TxHash>, postDeployCtor: (address: AztecAddress, wallet: Wallet) => Promise<TContract>,
28
+ constructor(pxeOrWallet: PXE | Wallet, txHashPromise: Promise<TxHash>, postDeployCtor: (address: AztecAddress, wallet: Wallet) => Promise<TContract>,
29
29
  /** A getter for the deployed contract instance */
30
30
  instanceGetter: () => Promise<ContractInstanceWithAddress>);
31
31
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"deploy_sent_tx.d.ts","sourceRoot":"","sources":["../../src/contract/deploy_sent_tx.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAErD,sDAAsD;AACtD,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG;IACx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IACmB,IAAI,CAAC,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;cAMxE,iBAAiB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;CAUvE"}
@@ -6,8 +6,8 @@ import { SentTx } from './sent_tx.js';
6
6
  postDeployCtor;
7
7
  instanceGetter;
8
8
  log;
9
- constructor(wallet, txHashPromise, postDeployCtor, /** A getter for the deployed contract instance */ instanceGetter){
10
- super(wallet, txHashPromise), this.postDeployCtor = postDeployCtor, this.instanceGetter = instanceGetter, this.log = createLogger('aztecjs:deploy_sent_tx');
9
+ constructor(pxeOrWallet, txHashPromise, postDeployCtor, /** A getter for the deployed contract instance */ instanceGetter){
10
+ super(pxeOrWallet, txHashPromise), this.postDeployCtor = postDeployCtor, this.instanceGetter = instanceGetter, this.log = createLogger('aztecjs:deploy_sent_tx');
11
11
  }
12
12
  /**
13
13
  * Awaits for the tx to be mined and returns the contract instance. Throws if tx is not mined.
@@ -32,8 +32,8 @@ import { SentTx } from './sent_tx.js';
32
32
  };
33
33
  }
34
34
  async getContractObject(wallet) {
35
- const isWallet = (pxe)=>!!pxe.createTxExecutionRequest;
36
- const contractWallet = wallet ?? (isWallet(this.pxe) && this.pxe);
35
+ const isWallet = (pxeOrWallet)=>!!pxeOrWallet.createTxExecutionRequest;
36
+ const contractWallet = wallet ?? (isWallet(this.pxeOrNode) && this.pxeOrNode);
37
37
  if (!contractWallet) {
38
38
  throw new Error(`A wallet is required for creating a contract instance`);
39
39
  }
@@ -1,5 +1,5 @@
1
1
  import type { FieldsOf } from '@aztec/foundation/types';
2
- import type { GetPublicLogsResponse, PXE } from '@aztec/stdlib/interfaces/client';
2
+ import type { AztecNode, GetPublicLogsResponse, PXE } from '@aztec/stdlib/interfaces/client';
3
3
  import { type TxHash, type TxReceipt } from '@aztec/stdlib/tx';
4
4
  /** Options related to waiting for a tx. */
5
5
  export type WaitOpts = {
@@ -20,13 +20,13 @@ export type WaitOpts = {
20
20
  };
21
21
  export declare const DefaultWaitOpts: WaitOpts;
22
22
  /**
23
- * The SentTx class represents a sent transaction through the PXE, providing methods to fetch
23
+ * The SentTx class represents a sent transaction through the PXE (or directly to a node) providing methods to fetch
24
24
  * its hash, receipt, and mining status.
25
25
  */
26
26
  export declare class SentTx {
27
- protected pxe: PXE;
27
+ protected pxeOrNode: PXE | AztecNode;
28
28
  protected txHashPromise: Promise<TxHash>;
29
- constructor(pxe: PXE, txHashPromise: Promise<TxHash>);
29
+ constructor(pxeOrNode: PXE | AztecNode, txHashPromise: Promise<TxHash>);
30
30
  /**
31
31
  * Retrieves the transaction hash of the SentTx instance.
32
32
  * The function internally awaits for the 'txHashPromise' to resolve, and then returns the resolved transaction hash.
@@ -1 +1 @@
1
- {"version":3,"file":"sent_tx.d.ts","sourceRoot":"","sources":["../../src/contract/sent_tx.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAY,MAAM,kBAAkB,CAAC;AAEzE,2CAA2C;AAC3C,MAAM,MAAM,QAAQ,GAAG;IACrB,gKAAgK;IAChK,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,6FAA6F;IAC7F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+FAA+F;IAC/F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sGAAsG;IACtG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kFAAkF;IAClF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0HAA0H;IAC1H,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,eAAe,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AC,EAAE,OAAO,CAAC;IACjB,kFAAkF;IAClF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0HAA0H;IAC1H,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,QAM7B,CAAC;AAEF;;;GAGG;AACH,qBAAa,MAAM;IACL,SAAS,CAAC,SAAS,EAAE,GAAG,GAAG,SAAS;IAAE,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC;gBAApE,SAAS,EAAE,GAAG,GAAG,SAAS,EAAY,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC;IAE1F;;;;;;OAMG;IACI,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAInC;;;;;;OAMG;IACU,UAAU,IAAI,OAAO,CAAC,SAAS,CAAC;IAK7C;;;;OAIG;IACU,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAuBhE;;;;OAIG;IACU,aAAa,IAAI,OAAO,CAAC,qBAAqB,CAAC;cAK5C,cAAc,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;cA8BnD,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ;CAWlE"}
@@ -8,13 +8,13 @@ export const DefaultWaitOpts = {
8
8
  debug: false
9
9
  };
10
10
  /**
11
- * The SentTx class represents a sent transaction through the PXE, providing methods to fetch
11
+ * The SentTx class represents a sent transaction through the PXE (or directly to a node) providing methods to fetch
12
12
  * its hash, receipt, and mining status.
13
13
  */ export class SentTx {
14
- pxe;
14
+ pxeOrNode;
15
15
  txHashPromise;
16
- constructor(pxe, txHashPromise){
17
- this.pxe = pxe;
16
+ constructor(pxeOrNode, txHashPromise){
17
+ this.pxeOrNode = pxeOrNode;
18
18
  this.txHashPromise = txHashPromise;
19
19
  }
20
20
  /**
@@ -34,7 +34,7 @@ export const DefaultWaitOpts = {
34
34
  * @returns A promise that resolves to a TxReceipt object representing the fetched transaction receipt.
35
35
  */ async getReceipt() {
36
36
  const txHash = await this.getTxHash();
37
- return await this.pxe.getTxReceipt(txHash);
37
+ return await this.pxeOrNode.getTxReceipt(txHash);
38
38
  }
39
39
  /**
40
40
  * Awaits for a tx to be mined and returns the receipt. Throws if tx is not mined.
@@ -50,7 +50,7 @@ export const DefaultWaitOpts = {
50
50
  }
51
51
  if (opts?.debug) {
52
52
  const txHash = await this.getTxHash();
53
- const { data: tx } = await this.pxe.getTxEffect(txHash);
53
+ const { data: tx } = await this.pxeOrNode.getTxEffect(txHash);
54
54
  receipt.debugInfo = {
55
55
  noteHashes: tx.noteHashes,
56
56
  nullifiers: tx.nullifiers,
@@ -66,7 +66,7 @@ export const DefaultWaitOpts = {
66
66
  * @returns The requested logs.
67
67
  */ async getPublicLogs() {
68
68
  await this.wait();
69
- return this.pxe.getPublicLogs({
69
+ return this.pxeOrNode.getPublicLogs({
70
70
  txHash: await this.getTxHash()
71
71
  });
72
72
  }
@@ -75,7 +75,7 @@ export const DefaultWaitOpts = {
75
75
  const startTime = Date.now();
76
76
  const ignoreDroppedReceiptsFor = opts?.ignoreDroppedReceiptsFor ?? DefaultWaitOpts.ignoreDroppedReceiptsFor;
77
77
  return await retryUntil(async ()=>{
78
- const txReceipt = await this.pxe.getTxReceipt(txHash);
78
+ const txReceipt = await this.pxeOrNode.getTxReceipt(txHash);
79
79
  // If receipt is not yet available, try again
80
80
  if (txReceipt.status === TxStatus.PENDING) {
81
81
  return undefined;
@@ -95,7 +95,7 @@ export const DefaultWaitOpts = {
95
95
  }
96
96
  async waitForProven(minedBlock, opts) {
97
97
  return await retryUntil(async ()=>{
98
- const provenBlock = await this.pxe.getProvenBlockNumber();
98
+ const provenBlock = await this.pxeOrNode.getProvenBlockNumber();
99
99
  return provenBlock >= minedBlock ? provenBlock : undefined;
100
100
  }, 'isProven', opts?.provenTimeout ?? DefaultWaitOpts.provenTimeout, opts?.interval ?? DefaultWaitOpts.interval);
101
101
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aztec/aztec.js",
3
3
  "homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec.js",
4
- "version": "0.77.0-testnet-ignition.26",
4
+ "version": "0.77.0-testnet-ignition.27",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": "./dest/index.js",
@@ -78,12 +78,12 @@
78
78
  ]
79
79
  },
80
80
  "dependencies": {
81
- "@aztec/constants": "0.77.0-testnet-ignition.26",
82
- "@aztec/ethereum": "0.77.0-testnet-ignition.26",
83
- "@aztec/foundation": "0.77.0-testnet-ignition.26",
84
- "@aztec/l1-artifacts": "0.77.0-testnet-ignition.26",
85
- "@aztec/protocol-contracts": "0.77.0-testnet-ignition.26",
86
- "@aztec/stdlib": "0.77.0-testnet-ignition.26",
81
+ "@aztec/constants": "0.77.0-testnet-ignition.27",
82
+ "@aztec/ethereum": "0.77.0-testnet-ignition.27",
83
+ "@aztec/foundation": "0.77.0-testnet-ignition.27",
84
+ "@aztec/l1-artifacts": "0.77.0-testnet-ignition.27",
85
+ "@aztec/protocol-contracts": "0.77.0-testnet-ignition.27",
86
+ "@aztec/stdlib": "0.77.0-testnet-ignition.27",
87
87
  "axios": "^1.7.2",
88
88
  "tslib": "^2.4.0",
89
89
  "viem": "2.22.8"
@@ -2,7 +2,7 @@ import { createLogger } from '@aztec/foundation/log';
2
2
  import type { FieldsOf } from '@aztec/foundation/types';
3
3
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
4
4
  import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
5
- import type { PXE } from '@aztec/stdlib/interfaces/client';
5
+ import type { AztecNode, PXE } from '@aztec/stdlib/interfaces/client';
6
6
  import type { TxHash, TxReceipt } from '@aztec/stdlib/tx';
7
7
 
8
8
  import type { Wallet } from '../account/index.js';
@@ -29,13 +29,13 @@ export class DeploySentTx<TContract extends Contract = Contract> extends SentTx
29
29
  private log = createLogger('aztecjs:deploy_sent_tx');
30
30
 
31
31
  constructor(
32
- wallet: PXE | Wallet,
32
+ pxeOrWallet: PXE | Wallet,
33
33
  txHashPromise: Promise<TxHash>,
34
34
  private postDeployCtor: (address: AztecAddress, wallet: Wallet) => Promise<TContract>,
35
35
  /** A getter for the deployed contract instance */
36
36
  public instanceGetter: () => Promise<ContractInstanceWithAddress>,
37
37
  ) {
38
- super(wallet, txHashPromise);
38
+ super(pxeOrWallet, txHashPromise);
39
39
  }
40
40
 
41
41
  /**
@@ -62,8 +62,9 @@ export class DeploySentTx<TContract extends Contract = Contract> extends SentTx
62
62
  }
63
63
 
64
64
  protected async getContractObject(wallet?: Wallet): Promise<TContract> {
65
- const isWallet = (pxe: PXE | Wallet): pxe is Wallet => !!(pxe as Wallet).createTxExecutionRequest;
66
- const contractWallet = wallet ?? (isWallet(this.pxe) && this.pxe);
65
+ const isWallet = (pxeOrWallet: PXE | Wallet | AztecNode): pxeOrWallet is Wallet =>
66
+ !!(pxeOrWallet as Wallet).createTxExecutionRequest;
67
+ const contractWallet = wallet ?? (isWallet(this.pxeOrNode) && this.pxeOrNode);
67
68
  if (!contractWallet) {
68
69
  throw new Error(`A wallet is required for creating a contract instance`);
69
70
  }
@@ -1,6 +1,6 @@
1
1
  import { retryUntil } from '@aztec/foundation/retry';
2
2
  import type { FieldsOf } from '@aztec/foundation/types';
3
- import type { GetPublicLogsResponse, PXE } from '@aztec/stdlib/interfaces/client';
3
+ import type { AztecNode, GetPublicLogsResponse, PXE } from '@aztec/stdlib/interfaces/client';
4
4
  import { type TxHash, type TxReceipt, TxStatus } from '@aztec/stdlib/tx';
5
5
 
6
6
  /** Options related to waiting for a tx. */
@@ -30,11 +30,11 @@ export const DefaultWaitOpts: WaitOpts = {
30
30
  };
31
31
 
32
32
  /**
33
- * The SentTx class represents a sent transaction through the PXE, providing methods to fetch
33
+ * The SentTx class represents a sent transaction through the PXE (or directly to a node) providing methods to fetch
34
34
  * its hash, receipt, and mining status.
35
35
  */
36
36
  export class SentTx {
37
- constructor(protected pxe: PXE, protected txHashPromise: Promise<TxHash>) {}
37
+ constructor(protected pxeOrNode: PXE | AztecNode, protected txHashPromise: Promise<TxHash>) {}
38
38
 
39
39
  /**
40
40
  * Retrieves the transaction hash of the SentTx instance.
@@ -56,7 +56,7 @@ export class SentTx {
56
56
  */
57
57
  public async getReceipt(): Promise<TxReceipt> {
58
58
  const txHash = await this.getTxHash();
59
- return await this.pxe.getTxReceipt(txHash);
59
+ return await this.pxeOrNode.getTxReceipt(txHash);
60
60
  }
61
61
 
62
62
  /**
@@ -76,7 +76,7 @@ export class SentTx {
76
76
  }
77
77
  if (opts?.debug) {
78
78
  const txHash = await this.getTxHash();
79
- const { data: tx } = (await this.pxe.getTxEffect(txHash))!;
79
+ const { data: tx } = (await this.pxeOrNode.getTxEffect(txHash))!;
80
80
  receipt.debugInfo = {
81
81
  noteHashes: tx.noteHashes,
82
82
  nullifiers: tx.nullifiers,
@@ -94,7 +94,7 @@ export class SentTx {
94
94
  */
95
95
  public async getPublicLogs(): Promise<GetPublicLogsResponse> {
96
96
  await this.wait();
97
- return this.pxe.getPublicLogs({ txHash: await this.getTxHash() });
97
+ return this.pxeOrNode.getPublicLogs({ txHash: await this.getTxHash() });
98
98
  }
99
99
 
100
100
  protected async waitForReceipt(opts?: WaitOpts): Promise<TxReceipt> {
@@ -104,7 +104,7 @@ export class SentTx {
104
104
 
105
105
  return await retryUntil(
106
106
  async () => {
107
- const txReceipt = await this.pxe.getTxReceipt(txHash);
107
+ const txReceipt = await this.pxeOrNode.getTxReceipt(txHash);
108
108
  // If receipt is not yet available, try again
109
109
  if (txReceipt.status === TxStatus.PENDING) {
110
110
  return undefined;
@@ -130,7 +130,7 @@ export class SentTx {
130
130
  protected async waitForProven(minedBlock: number, opts?: WaitOpts) {
131
131
  return await retryUntil(
132
132
  async () => {
133
- const provenBlock = await this.pxe.getProvenBlockNumber();
133
+ const provenBlock = await this.pxeOrNode.getProvenBlockNumber();
134
134
  return provenBlock >= minedBlock ? provenBlock : undefined;
135
135
  },
136
136
  'isProven',