@aztec/aztec.js 0.32.0 → 0.33.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 (152) hide show
  1. package/README.md +2 -2
  2. package/dest/account/contract.d.ts +4 -4
  3. package/dest/account/contract.d.ts.map +1 -1
  4. package/dest/account/index.d.ts +1 -1
  5. package/dest/account/index.d.ts.map +1 -1
  6. package/dest/account/interface.d.ts +5 -5
  7. package/dest/account/interface.d.ts.map +1 -1
  8. package/dest/account/wallet.d.ts +2 -2
  9. package/dest/account/wallet.d.ts.map +1 -1
  10. package/dest/account_manager/deploy_account_sent_tx.d.ts +4 -4
  11. package/dest/account_manager/deploy_account_sent_tx.d.ts.map +1 -1
  12. package/dest/account_manager/deploy_account_sent_tx.js +1 -1
  13. package/dest/account_manager/index.d.ts +7 -7
  14. package/dest/account_manager/index.d.ts.map +1 -1
  15. package/dest/account_manager/index.js +1 -1
  16. package/dest/contract/base_contract_interaction.d.ts +4 -4
  17. package/dest/contract/base_contract_interaction.d.ts.map +1 -1
  18. package/dest/contract/base_contract_interaction.js +5 -5
  19. package/dest/contract/batch_call.d.ts +3 -3
  20. package/dest/contract/batch_call.d.ts.map +1 -1
  21. package/dest/contract/batch_call.js +1 -1
  22. package/dest/contract/checker.d.ts +1 -1
  23. package/dest/contract/checker.d.ts.map +1 -1
  24. package/dest/contract/checker.js +2 -2
  25. package/dest/contract/contract.d.ts +4 -4
  26. package/dest/contract/contract.d.ts.map +1 -1
  27. package/dest/contract/contract_base.d.ts +44 -4
  28. package/dest/contract/contract_base.d.ts.map +1 -1
  29. package/dest/contract/contract_base.js +1 -1
  30. package/dest/contract/contract_function_interaction.d.ts +21 -12
  31. package/dest/contract/contract_function_interaction.d.ts.map +1 -1
  32. package/dest/contract/contract_function_interaction.js +41 -11
  33. package/dest/contract/deploy_method.d.ts +11 -11
  34. package/dest/contract/deploy_method.d.ts.map +1 -1
  35. package/dest/contract/deploy_method.js +8 -6
  36. package/dest/contract/deploy_sent_tx.d.ts +8 -7
  37. package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
  38. package/dest/contract/deploy_sent_tx.js +4 -1
  39. package/dest/contract/index.d.ts +3 -3
  40. package/dest/contract/index.js +3 -3
  41. package/dest/contract/sent_tx.d.ts +2 -2
  42. package/dest/contract/sent_tx.d.ts.map +1 -1
  43. package/dest/contract/sent_tx.js +6 -6
  44. package/dest/contract/unsafe_contract.d.ts +3 -3
  45. package/dest/contract/unsafe_contract.d.ts.map +1 -1
  46. package/dest/deployment/broadcast_function.d.ts +3 -3
  47. package/dest/deployment/broadcast_function.d.ts.map +1 -1
  48. package/dest/deployment/broadcast_function.js +1 -1
  49. package/dest/deployment/contract_deployer.d.ts +2 -2
  50. package/dest/deployment/contract_deployer.d.ts.map +1 -1
  51. package/dest/deployment/deploy_instance.d.ts +3 -3
  52. package/dest/deployment/deploy_instance.d.ts.map +1 -1
  53. package/dest/deployment/protocol_contracts.d.ts +1 -1
  54. package/dest/deployment/protocol_contracts.d.ts.map +1 -1
  55. package/dest/deployment/register_class.d.ts +3 -3
  56. package/dest/deployment/register_class.d.ts.map +1 -1
  57. package/dest/deployment/register_class.js +1 -1
  58. package/dest/entrypoint/default_entrypoint.d.ts +2 -2
  59. package/dest/entrypoint/default_entrypoint.d.ts.map +1 -1
  60. package/dest/entrypoint/default_entrypoint.js +1 -1
  61. package/dest/entrypoint/entrypoint.d.ts +3 -3
  62. package/dest/entrypoint/entrypoint.d.ts.map +1 -1
  63. package/dest/fee/fee_payment_method.d.ts +3 -3
  64. package/dest/fee/fee_payment_method.d.ts.map +1 -1
  65. package/dest/fee/native_fee_payment_method.d.ts +5 -5
  66. package/dest/fee/native_fee_payment_method.d.ts.map +1 -1
  67. package/dest/fee/native_fee_payment_method.js +1 -1
  68. package/dest/fee/private_fee_payment_method.d.ts +4 -4
  69. package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
  70. package/dest/fee/public_fee_payment_method.d.ts +4 -4
  71. package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
  72. package/dest/index.d.ts +1 -1
  73. package/dest/index.d.ts.map +1 -1
  74. package/dest/index.js +1 -1
  75. package/dest/rpc_clients/pxe_client.d.ts +1 -1
  76. package/dest/rpc_clients/pxe_client.d.ts.map +1 -1
  77. package/dest/rpc_clients/pxe_client.js +3 -3
  78. package/dest/utils/abi_types.d.ts +1 -1
  79. package/dest/utils/abi_types.d.ts.map +1 -1
  80. package/dest/utils/account.d.ts +2 -2
  81. package/dest/utils/account.d.ts.map +1 -1
  82. package/dest/utils/account.js +1 -1
  83. package/dest/utils/authwit.d.ts +2 -2
  84. package/dest/utils/authwit.d.ts.map +1 -1
  85. package/dest/utils/authwit.js +1 -1
  86. package/dest/utils/cheat_codes.d.ts +2 -2
  87. package/dest/utils/cheat_codes.d.ts.map +1 -1
  88. package/dest/utils/cheat_codes.js +1 -1
  89. package/dest/utils/l1_contracts.d.ts +1 -1
  90. package/dest/utils/l1_contracts.d.ts.map +1 -1
  91. package/dest/utils/pub_key.d.ts +1 -1
  92. package/dest/utils/pub_key.d.ts.map +1 -1
  93. package/dest/utils/pxe.d.ts +2 -2
  94. package/dest/utils/pxe.d.ts.map +1 -1
  95. package/dest/wallet/account_wallet.d.ts +4 -4
  96. package/dest/wallet/account_wallet.d.ts.map +1 -1
  97. package/dest/wallet/account_wallet.js +2 -2
  98. package/dest/wallet/account_wallet_with_private_key.d.ts +4 -4
  99. package/dest/wallet/account_wallet_with_private_key.d.ts.map +1 -1
  100. package/dest/wallet/base_wallet.d.ts +10 -9
  101. package/dest/wallet/base_wallet.d.ts.map +1 -1
  102. package/dest/wallet/base_wallet.js +6 -3
  103. package/dest/wallet/create_recipient.d.ts +1 -1
  104. package/dest/wallet/create_recipient.d.ts.map +1 -1
  105. package/dest/wallet/index.d.ts +3 -3
  106. package/dest/wallet/index.d.ts.map +1 -1
  107. package/dest/wallet/signerless_wallet.d.ts +3 -3
  108. package/dest/wallet/signerless_wallet.d.ts.map +1 -1
  109. package/package.json +17 -11
  110. package/src/account/contract.ts +4 -4
  111. package/src/account/index.ts +1 -1
  112. package/src/account/interface.ts +5 -5
  113. package/src/account/wallet.ts +2 -2
  114. package/src/account_manager/deploy_account_sent_tx.ts +4 -4
  115. package/src/account_manager/index.ts +8 -8
  116. package/src/contract/base_contract_interaction.ts +6 -6
  117. package/src/contract/batch_call.ts +3 -3
  118. package/src/contract/checker.ts +4 -4
  119. package/src/contract/contract.ts +4 -4
  120. package/src/contract/contract_base.ts +46 -4
  121. package/src/contract/contract_function_interaction.ts +47 -16
  122. package/src/contract/deploy_method.ts +17 -13
  123. package/src/contract/deploy_sent_tx.ts +11 -7
  124. package/src/contract/index.ts +3 -3
  125. package/src/contract/sent_tx.ts +13 -6
  126. package/src/contract/unsafe_contract.ts +3 -3
  127. package/src/deployment/broadcast_function.ts +3 -3
  128. package/src/deployment/contract_deployer.ts +4 -4
  129. package/src/deployment/deploy_instance.ts +3 -3
  130. package/src/deployment/protocol_contracts.ts +1 -1
  131. package/src/deployment/register_class.ts +3 -3
  132. package/src/entrypoint/default_entrypoint.ts +2 -2
  133. package/src/entrypoint/entrypoint.ts +3 -3
  134. package/src/fee/fee_payment_method.ts +3 -3
  135. package/src/fee/native_fee_payment_method.ts +5 -5
  136. package/src/fee/private_fee_payment_method.ts +4 -4
  137. package/src/fee/public_fee_payment_method.ts +4 -4
  138. package/src/index.ts +2 -0
  139. package/src/rpc_clients/pxe_client.ts +3 -2
  140. package/src/utils/abi_types.ts +1 -1
  141. package/src/utils/account.ts +2 -2
  142. package/src/utils/authwit.ts +2 -2
  143. package/src/utils/cheat_codes.ts +2 -2
  144. package/src/utils/l1_contracts.ts +1 -1
  145. package/src/utils/pub_key.ts +1 -1
  146. package/src/utils/pxe.ts +2 -2
  147. package/src/wallet/account_wallet.ts +6 -6
  148. package/src/wallet/account_wallet_with_private_key.ts +4 -4
  149. package/src/wallet/base_wallet.ts +33 -23
  150. package/src/wallet/create_recipient.ts +1 -1
  151. package/src/wallet/index.ts +3 -3
  152. package/src/wallet/signerless_wallet.ts +3 -3
@@ -1,4 +1,4 @@
1
- import { GrumpkinPrivateKey, PublicKey } from '@aztec/circuits.js';
1
+ import { type GrumpkinPrivateKey, type PublicKey } from '@aztec/circuits.js';
2
2
  import { Grumpkin } from '@aztec/circuits.js/barretenberg';
3
3
 
4
4
  /**
package/src/utils/pxe.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { PXE } from '@aztec/circuit-types';
2
- import { DebugLogger } from '@aztec/foundation/log';
1
+ import { type PXE } from '@aztec/circuit-types';
2
+ import { type DebugLogger } from '@aztec/foundation/log';
3
3
  import { retryUntil } from '@aztec/foundation/retry';
4
4
 
5
5
  export const waitForPXE = async (pxe: PXE, logger?: DebugLogger) => {
@@ -1,10 +1,10 @@
1
- import { AuthWitness, FunctionCall, PXE, TxExecutionRequest } from '@aztec/circuit-types';
2
- import { AztecAddress, Fr } from '@aztec/circuits.js';
3
- import { ABIParameterVisibility, FunctionAbi, FunctionType } from '@aztec/foundation/abi';
1
+ import { type AuthWitness, type FunctionCall, type PXE, type TxExecutionRequest } from '@aztec/circuit-types';
2
+ import { type AztecAddress, Fr } from '@aztec/circuits.js';
3
+ import { type ABIParameterVisibility, type FunctionAbi, FunctionType } from '@aztec/foundation/abi';
4
4
 
5
- import { AccountInterface } from '../account/interface.js';
5
+ import { type AccountInterface } from '../account/interface.js';
6
6
  import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
7
- import { FeeOptions } from '../entrypoint/entrypoint.js';
7
+ import { type FeeOptions } from '../entrypoint/entrypoint.js';
8
8
  import { computeAuthWitMessageHash } from '../utils/authwit.js';
9
9
  import { BaseWallet } from './base_wallet.js';
10
10
 
@@ -161,7 +161,7 @@ export class AccountWallet extends BaseWallet {
161
161
  messageHash,
162
162
  ]);
163
163
 
164
- const [isValidInPrivate, isValidInPublic] = await interaction.view();
164
+ const [isValidInPrivate, isValidInPublic] = (await interaction.simulate()) as [boolean, boolean];
165
165
  return { isValidInPrivate, isValidInPublic };
166
166
  }
167
167
 
@@ -1,8 +1,8 @@
1
- import { PXE } from '@aztec/circuit-types';
2
- import { GrumpkinPrivateKey } from '@aztec/circuits.js';
1
+ import { type PXE } from '@aztec/circuit-types';
2
+ import { type GrumpkinPrivateKey } from '@aztec/circuits.js';
3
3
 
4
- import { Salt } from '../account/index.js';
5
- import { AccountInterface } from '../account/interface.js';
4
+ import { type Salt } from '../account/index.js';
5
+ import { type AccountInterface } from '../account/interface.js';
6
6
  import { AccountWallet } from './account_wallet.js';
7
7
 
8
8
  /**
@@ -1,27 +1,34 @@
1
1
  import {
2
- AuthWitness,
3
- ExtendedNote,
4
- FunctionCall,
5
- GetUnencryptedLogsResponse,
6
- L2Block,
7
- LogFilter,
8
- NoteFilter,
9
- PXE,
10
- SyncStatus,
11
- Tx,
12
- TxEffect,
13
- TxExecutionRequest,
14
- TxHash,
15
- TxReceipt,
2
+ type AuthWitness,
3
+ type ExtendedNote,
4
+ type FunctionCall,
5
+ type GetUnencryptedLogsResponse,
6
+ type L2Block,
7
+ type LogFilter,
8
+ type NoteFilter,
9
+ type PXE,
10
+ type SimulatedTx,
11
+ type SyncStatus,
12
+ type Tx,
13
+ type TxEffect,
14
+ type TxExecutionRequest,
15
+ type TxHash,
16
+ type TxReceipt,
16
17
  } from '@aztec/circuit-types';
17
- import { AztecAddress, CompleteAddress, Fr, GrumpkinPrivateKey, PartialAddress } from '@aztec/circuits.js';
18
- import { ContractArtifact } from '@aztec/foundation/abi';
19
- import { ContractClassWithId, ContractInstanceWithAddress } from '@aztec/types/contracts';
20
- import { NodeInfo } from '@aztec/types/interfaces';
18
+ import {
19
+ type AztecAddress,
20
+ type CompleteAddress,
21
+ type Fr,
22
+ type GrumpkinPrivateKey,
23
+ type PartialAddress,
24
+ } from '@aztec/circuits.js';
25
+ import { type ContractArtifact } from '@aztec/foundation/abi';
26
+ import { type ContractClassWithId, type ContractInstanceWithAddress } from '@aztec/types/contracts';
27
+ import { type NodeInfo } from '@aztec/types/interfaces';
21
28
 
22
- import { Wallet } from '../account/wallet.js';
23
- import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
24
- import { FeeOptions } from '../entrypoint/entrypoint.js';
29
+ import { type Wallet } from '../account/wallet.js';
30
+ import { type ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
31
+ import { type FeeOptions } from '../entrypoint/entrypoint.js';
25
32
 
26
33
  /**
27
34
  * A base class for Wallet implementations
@@ -95,8 +102,11 @@ export abstract class BaseWallet implements Wallet {
95
102
  getContracts(): Promise<AztecAddress[]> {
96
103
  return this.pxe.getContracts();
97
104
  }
98
- simulateTx(txRequest: TxExecutionRequest, simulatePublic: boolean): Promise<Tx> {
99
- return this.pxe.simulateTx(txRequest, simulatePublic);
105
+ proveTx(txRequest: TxExecutionRequest, simulatePublic: boolean): Promise<Tx> {
106
+ return this.pxe.proveTx(txRequest, simulatePublic);
107
+ }
108
+ simulateTx(txRequest: TxExecutionRequest, simulatePublic: boolean, msgSender: AztecAddress): Promise<SimulatedTx> {
109
+ return this.pxe.simulateTx(txRequest, simulatePublic, msgSender);
100
110
  }
101
111
  sendTx(tx: Tx): Promise<TxHash> {
102
112
  return this.pxe.sendTx(tx);
@@ -1,4 +1,4 @@
1
- import { PXE } from '@aztec/circuit-types';
1
+ import { type PXE } from '@aztec/circuit-types';
2
2
  import { CompleteAddress } from '@aztec/circuits.js';
3
3
 
4
4
  /**
@@ -1,7 +1,7 @@
1
- import { PXE } from '@aztec/circuit-types';
2
- import { AztecAddress } from '@aztec/foundation/aztec-address';
1
+ import { type PXE } from '@aztec/circuit-types';
2
+ import { type AztecAddress } from '@aztec/foundation/aztec-address';
3
3
 
4
- import { AccountContract } from '../account/contract.js';
4
+ import { type AccountContract } from '../account/contract.js';
5
5
  import { AccountWallet } from './account_wallet.js';
6
6
 
7
7
  export * from '../account/wallet.js';
@@ -1,8 +1,8 @@
1
- import { AuthWitness, FunctionCall, PXE, TxExecutionRequest } from '@aztec/circuit-types';
2
- import { CompleteAddress, Fr } from '@aztec/circuits.js';
1
+ import { type AuthWitness, type FunctionCall, type PXE, type TxExecutionRequest } from '@aztec/circuit-types';
2
+ import { type CompleteAddress, type Fr } from '@aztec/circuits.js';
3
3
 
4
4
  import { DefaultEntrypoint } from '../entrypoint/default_entrypoint.js';
5
- import { EntrypointInterface } from '../entrypoint/entrypoint.js';
5
+ import { type EntrypointInterface } from '../entrypoint/entrypoint.js';
6
6
  import { BaseWallet } from './base_wallet.js';
7
7
 
8
8
  /**