@aztec/aztec.js 0.86.0 → 0.87.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.
Files changed (67) hide show
  1. package/dest/account_manager/deploy_account_sent_tx.d.ts.map +1 -1
  2. package/dest/contract/base_contract_interaction.d.ts +1 -1
  3. package/dest/contract/base_contract_interaction.d.ts.map +1 -1
  4. package/dest/contract/base_contract_interaction.js +2 -3
  5. package/dest/contract/batch_call.d.ts.map +1 -1
  6. package/dest/contract/batch_call.js +1 -1
  7. package/dest/contract/contract_function_interaction.d.ts +24 -2
  8. package/dest/contract/contract_function_interaction.d.ts.map +1 -1
  9. package/dest/contract/contract_function_interaction.js +28 -15
  10. package/dest/contract/deploy_method.d.ts +15 -3
  11. package/dest/contract/deploy_method.d.ts.map +1 -1
  12. package/dest/contract/deploy_method.js +13 -5
  13. package/dest/contract/deploy_proven_tx.d.ts +2 -2
  14. package/dest/contract/deploy_proven_tx.d.ts.map +1 -1
  15. package/dest/contract/deploy_proven_tx.js +2 -2
  16. package/dest/contract/interaction_options.d.ts +4 -2
  17. package/dest/contract/interaction_options.d.ts.map +1 -1
  18. package/dest/contract/proven_tx.d.ts +3 -2
  19. package/dest/contract/proven_tx.d.ts.map +1 -1
  20. package/dest/contract/proven_tx.js +4 -2
  21. package/dest/contract/sent_tx.d.ts.map +1 -1
  22. package/dest/deployment/contract_deployer.d.ts.map +1 -1
  23. package/dest/ethereum/l1_contracts.d.ts.map +1 -1
  24. package/dest/ethereum/l1_contracts.js +1 -1
  25. package/dest/fee/account_entrypoint_meta_payment_method.d.ts.map +1 -1
  26. package/dest/rpc_clients/node/index.js +9 -15
  27. package/dest/test/anvil_test_watcher.d.ts.map +1 -1
  28. package/dest/test/anvil_test_watcher.js +1 -1
  29. package/dest/test/rollup_cheat_codes.d.ts +5 -0
  30. package/dest/test/rollup_cheat_codes.d.ts.map +1 -1
  31. package/dest/test/rollup_cheat_codes.js +16 -0
  32. package/dest/utils/abi_types.d.ts +0 -2
  33. package/dest/utils/abi_types.d.ts.map +1 -1
  34. package/dest/utils/authwit.d.ts +0 -2
  35. package/dest/utils/authwit.d.ts.map +1 -1
  36. package/dest/utils/field_compressed_string.d.ts.map +1 -1
  37. package/dest/utils/node.d.ts.map +1 -1
  38. package/dest/utils/node.js +1 -1
  39. package/dest/utils/pxe.d.ts.map +1 -1
  40. package/dest/utils/pxe.js +1 -1
  41. package/dest/wallet/account_wallet.d.ts +0 -2
  42. package/dest/wallet/account_wallet.d.ts.map +1 -1
  43. package/dest/wallet/base_wallet.d.ts +4 -6
  44. package/dest/wallet/base_wallet.d.ts.map +1 -1
  45. package/dest/wallet/base_wallet.js +2 -2
  46. package/dest/wallet/signerless_wallet.d.ts +0 -2
  47. package/dest/wallet/signerless_wallet.d.ts.map +1 -1
  48. package/package.json +11 -11
  49. package/src/account_manager/deploy_account_sent_tx.ts +5 -1
  50. package/src/contract/base_contract_interaction.ts +3 -4
  51. package/src/contract/batch_call.ts +5 -2
  52. package/src/contract/contract_function_interaction.ts +52 -7
  53. package/src/contract/deploy_method.ts +40 -7
  54. package/src/contract/deploy_proven_tx.ts +3 -2
  55. package/src/contract/interaction_options.ts +4 -2
  56. package/src/contract/proven_tx.ts +7 -2
  57. package/src/contract/sent_tx.ts +4 -1
  58. package/src/ethereum/l1_contracts.ts +1 -1
  59. package/src/fee/account_entrypoint_meta_payment_method.ts +2 -3
  60. package/src/rpc_clients/node/index.ts +8 -8
  61. package/src/test/anvil_test_watcher.ts +1 -1
  62. package/src/test/rollup_cheat_codes.ts +20 -1
  63. package/src/utils/node.ts +1 -1
  64. package/src/utils/pxe.ts +1 -1
  65. package/src/wallet/account_wallet.ts +4 -1
  66. package/src/wallet/base_wallet.ts +6 -4
  67. package/src/wallet/signerless_wallet.ts +4 -1
@@ -15,7 +15,10 @@ export class RollupCheatCodes {
15
15
 
16
16
  private logger = createLogger('aztecjs:cheat_codes');
17
17
 
18
- constructor(private ethCheatCodes: EthCheatCodes, addresses: Pick<L1ContractAddresses, 'rollupAddress'>) {
18
+ constructor(
19
+ private ethCheatCodes: EthCheatCodes,
20
+ addresses: Pick<L1ContractAddresses, 'rollupAddress'>,
21
+ ) {
19
22
  this.client = createPublicClient({
20
23
  chain: foundry,
21
24
  transport: fallback(ethCheatCodes.rpcUrls.map(url => http(url))),
@@ -88,6 +91,22 @@ export class RollupCheatCodes {
88
91
  return { epochDuration, slotDuration };
89
92
  }
90
93
 
94
+ /**
95
+ * Advances time to the beginning of the given epoch
96
+ * @param epoch - The epoch to advance to
97
+ */
98
+ public async advanceToEpoch(epoch: bigint) {
99
+ const { epochDuration: slotsInEpoch } = await this.getConfig();
100
+ const timestamp = await this.rollup.read.getTimestampForSlot([epoch * slotsInEpoch]);
101
+ try {
102
+ await this.ethCheatCodes.warp(Number(timestamp));
103
+ this.logger.warn(`Warped to epoch ${epoch}`);
104
+ } catch {
105
+ this.logger.debug('Warp failed, time already satisfied');
106
+ }
107
+ return timestamp;
108
+ }
109
+
91
110
  /** Warps time in L1 until the next epoch */
92
111
  public async advanceToNextEpoch() {
93
112
  const slot = await this.getSlot();
package/src/utils/node.ts CHANGED
@@ -9,7 +9,7 @@ export const waitForNode = async (node: AztecNode, logger?: Logger) => {
9
9
  await node.getNodeInfo();
10
10
  logger?.verbose('Contacted Aztec node');
11
11
  return true;
12
- } catch (error) {
12
+ } catch {
13
13
  logger?.verbose('Failed to contact Aztec Node');
14
14
  }
15
15
  return undefined;
package/src/utils/pxe.ts CHANGED
@@ -9,7 +9,7 @@ export const waitForPXE = async (pxe: PXE, logger?: Logger) => {
9
9
  await pxe.getNodeInfo();
10
10
  logger?.verbose('Contacted PXE');
11
11
  return true;
12
- } catch (error) {
12
+ } catch {
13
13
  logger?.verbose('Failed to contact PXE');
14
14
  }
15
15
  return undefined;
@@ -22,7 +22,10 @@ import { BaseWallet } from './base_wallet.js';
22
22
  * A wallet implementation that forwards authentication requests to a provided account.
23
23
  */
24
24
  export class AccountWallet extends BaseWallet {
25
- constructor(pxe: PXE, protected account: AccountInterface) {
25
+ constructor(
26
+ pxe: PXE,
27
+ protected account: AccountInterface,
28
+ ) {
26
29
  super(pxe);
27
30
  }
28
31
 
@@ -1,7 +1,7 @@
1
1
  import type { FeeOptions, TxExecutionOptions } from '@aztec/entrypoints/interfaces';
2
2
  import type { ExecutionPayload } from '@aztec/entrypoints/payload';
3
3
  import type { Fr } from '@aztec/foundation/fields';
4
- import type { AbiDecoded, ContractArtifact } from '@aztec/stdlib/abi';
4
+ import type { ContractArtifact } from '@aztec/stdlib/abi';
5
5
  import type { AuthWitness } from '@aztec/stdlib/auth-witness';
6
6
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
7
7
  import type { CompleteAddress, ContractInstanceWithAddress, NodeInfo } from '@aztec/stdlib/contract';
@@ -22,6 +22,7 @@ import type {
22
22
  TxProvingResult,
23
23
  TxReceipt,
24
24
  TxSimulationResult,
25
+ UtilitySimulationResult,
25
26
  } from '@aztec/stdlib/tx';
26
27
 
27
28
  import type { IntentAction, IntentInnerHash } from '../utils/authwit.js';
@@ -78,9 +79,10 @@ export abstract class BaseWallet implements Wallet {
78
79
  profileTx(
79
80
  txRequest: TxExecutionRequest,
80
81
  profileMode: 'gates' | 'execution-steps' | 'full',
82
+ skipProofGeneration?: boolean,
81
83
  msgSender?: AztecAddress,
82
84
  ): Promise<TxProfileResult> {
83
- return this.pxe.profileTx(txRequest, profileMode, msgSender);
85
+ return this.pxe.profileTx(txRequest, profileMode, skipProofGeneration, msgSender);
84
86
  }
85
87
  simulateTx(
86
88
  txRequest: TxExecutionRequest,
@@ -102,8 +104,8 @@ export abstract class BaseWallet implements Wallet {
102
104
  args: any[],
103
105
  to: AztecAddress,
104
106
  authwits?: AuthWitness[],
105
- from?: AztecAddress | undefined,
106
- ): Promise<AbiDecoded> {
107
+ from?: AztecAddress,
108
+ ): Promise<UtilitySimulationResult> {
107
109
  return this.pxe.simulateUtility(functionName, args, to, authwits, from);
108
110
  }
109
111
  getNodeInfo(): Promise<NodeInfo> {
@@ -14,7 +14,10 @@ import { BaseWallet } from './base_wallet.js';
14
14
  * Wallet implementation which creates a transaction request directly to the requested contract without any signing.
15
15
  */
16
16
  export class SignerlessWallet extends BaseWallet {
17
- constructor(pxe: PXE, private entrypoint?: EntrypointInterface) {
17
+ constructor(
18
+ pxe: PXE,
19
+ private entrypoint?: EntrypointInterface,
20
+ ) {
18
21
  super(pxe);
19
22
  }
20
23
  async createTxExecutionRequest(