@aztec/aztec.js 0.31.0 → 0.32.1

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 (146) hide show
  1. package/dest/account/contract.d.ts +4 -4
  2. package/dest/account/contract.d.ts.map +1 -1
  3. package/dest/account/index.d.ts +1 -1
  4. package/dest/account/index.d.ts.map +1 -1
  5. package/dest/account/interface.d.ts +5 -5
  6. package/dest/account/interface.d.ts.map +1 -1
  7. package/dest/account/wallet.d.ts +2 -2
  8. package/dest/account/wallet.d.ts.map +1 -1
  9. package/dest/account_manager/deploy_account_sent_tx.d.ts +4 -4
  10. package/dest/account_manager/deploy_account_sent_tx.d.ts.map +1 -1
  11. package/dest/account_manager/deploy_account_sent_tx.js +1 -1
  12. package/dest/account_manager/index.d.ts +7 -7
  13. package/dest/account_manager/index.d.ts.map +1 -1
  14. package/dest/account_manager/index.js +1 -1
  15. package/dest/contract/base_contract_interaction.d.ts +2 -2
  16. package/dest/contract/base_contract_interaction.d.ts.map +1 -1
  17. package/dest/contract/batch_call.d.ts +3 -3
  18. package/dest/contract/batch_call.d.ts.map +1 -1
  19. package/dest/contract/batch_call.js +1 -1
  20. package/dest/contract/checker.d.ts +1 -1
  21. package/dest/contract/checker.d.ts.map +1 -1
  22. package/dest/contract/contract.d.ts +4 -4
  23. package/dest/contract/contract.d.ts.map +1 -1
  24. package/dest/contract/contract_base.d.ts +3 -3
  25. package/dest/contract/contract_base.d.ts.map +1 -1
  26. package/dest/contract/contract_base.js +1 -1
  27. package/dest/contract/contract_function_interaction.d.ts +4 -4
  28. package/dest/contract/contract_function_interaction.d.ts.map +1 -1
  29. package/dest/contract/contract_function_interaction.js +1 -1
  30. package/dest/contract/deploy_method.d.ts +8 -8
  31. package/dest/contract/deploy_method.d.ts.map +1 -1
  32. package/dest/contract/deploy_method.js +1 -1
  33. package/dest/contract/deploy_sent_tx.d.ts +7 -7
  34. package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
  35. package/dest/contract/deploy_sent_tx.js +1 -1
  36. package/dest/contract/sent_tx.d.ts +2 -2
  37. package/dest/contract/sent_tx.d.ts.map +1 -1
  38. package/dest/contract/sent_tx.js +2 -2
  39. package/dest/contract/unsafe_contract.d.ts +3 -3
  40. package/dest/contract/unsafe_contract.d.ts.map +1 -1
  41. package/dest/deployment/broadcast_function.d.ts +3 -3
  42. package/dest/deployment/broadcast_function.d.ts.map +1 -1
  43. package/dest/deployment/broadcast_function.js +1 -1
  44. package/dest/deployment/contract_deployer.d.ts +2 -2
  45. package/dest/deployment/contract_deployer.d.ts.map +1 -1
  46. package/dest/deployment/deploy_instance.d.ts +3 -3
  47. package/dest/deployment/deploy_instance.d.ts.map +1 -1
  48. package/dest/deployment/protocol_contracts.d.ts +1 -1
  49. package/dest/deployment/protocol_contracts.d.ts.map +1 -1
  50. package/dest/deployment/register_class.d.ts +3 -3
  51. package/dest/deployment/register_class.d.ts.map +1 -1
  52. package/dest/deployment/register_class.js +1 -1
  53. package/dest/entrypoint/default_entrypoint.d.ts +2 -2
  54. package/dest/entrypoint/default_entrypoint.d.ts.map +1 -1
  55. package/dest/entrypoint/default_entrypoint.js +1 -1
  56. package/dest/entrypoint/entrypoint.d.ts +3 -3
  57. package/dest/entrypoint/entrypoint.d.ts.map +1 -1
  58. package/dest/fee/fee_payment_method.d.ts +3 -3
  59. package/dest/fee/fee_payment_method.d.ts.map +1 -1
  60. package/dest/fee/native_fee_payment_method.d.ts +5 -5
  61. package/dest/fee/native_fee_payment_method.d.ts.map +1 -1
  62. package/dest/fee/native_fee_payment_method.js +1 -6
  63. package/dest/fee/private_fee_payment_method.d.ts +4 -4
  64. package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
  65. package/dest/fee/public_fee_payment_method.d.ts +4 -4
  66. package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
  67. package/dest/index.d.ts +1 -1
  68. package/dest/index.d.ts.map +1 -1
  69. package/dest/index.js +2 -2
  70. package/dest/rpc_clients/pxe_client.d.ts +1 -1
  71. package/dest/rpc_clients/pxe_client.d.ts.map +1 -1
  72. package/dest/rpc_clients/pxe_client.js +3 -3
  73. package/dest/utils/abi_types.d.ts +1 -1
  74. package/dest/utils/abi_types.d.ts.map +1 -1
  75. package/dest/utils/account.d.ts +2 -2
  76. package/dest/utils/account.d.ts.map +1 -1
  77. package/dest/utils/account.js +1 -1
  78. package/dest/utils/authwit.d.ts +2 -2
  79. package/dest/utils/authwit.d.ts.map +1 -1
  80. package/dest/utils/authwit.js +3 -3
  81. package/dest/utils/cheat_codes.d.ts +2 -2
  82. package/dest/utils/cheat_codes.d.ts.map +1 -1
  83. package/dest/utils/cheat_codes.js +2 -2
  84. package/dest/utils/l1_contracts.d.ts +1 -1
  85. package/dest/utils/l1_contracts.d.ts.map +1 -1
  86. package/dest/utils/pub_key.d.ts +1 -1
  87. package/dest/utils/pub_key.d.ts.map +1 -1
  88. package/dest/utils/pxe.d.ts +2 -2
  89. package/dest/utils/pxe.d.ts.map +1 -1
  90. package/dest/wallet/account_wallet.d.ts +4 -4
  91. package/dest/wallet/account_wallet.d.ts.map +1 -1
  92. package/dest/wallet/account_wallet.js +1 -1
  93. package/dest/wallet/account_wallet_with_private_key.d.ts +4 -4
  94. package/dest/wallet/account_wallet_with_private_key.d.ts.map +1 -1
  95. package/dest/wallet/base_wallet.d.ts +8 -8
  96. package/dest/wallet/base_wallet.d.ts.map +1 -1
  97. package/dest/wallet/base_wallet.js +1 -1
  98. package/dest/wallet/create_recipient.d.ts +1 -1
  99. package/dest/wallet/create_recipient.d.ts.map +1 -1
  100. package/dest/wallet/index.d.ts +3 -3
  101. package/dest/wallet/index.d.ts.map +1 -1
  102. package/dest/wallet/signerless_wallet.d.ts +3 -3
  103. package/dest/wallet/signerless_wallet.d.ts.map +1 -1
  104. package/package.json +7 -7
  105. package/src/account/contract.ts +4 -4
  106. package/src/account/index.ts +1 -1
  107. package/src/account/interface.ts +5 -5
  108. package/src/account/wallet.ts +2 -2
  109. package/src/account_manager/deploy_account_sent_tx.ts +4 -4
  110. package/src/account_manager/index.ts +8 -8
  111. package/src/contract/base_contract_interaction.ts +2 -2
  112. package/src/contract/batch_call.ts +3 -3
  113. package/src/contract/checker.ts +1 -1
  114. package/src/contract/contract.ts +4 -4
  115. package/src/contract/contract_base.ts +3 -3
  116. package/src/contract/contract_function_interaction.ts +4 -4
  117. package/src/contract/deploy_method.ts +8 -8
  118. package/src/contract/deploy_sent_tx.ts +7 -7
  119. package/src/contract/sent_tx.ts +9 -2
  120. package/src/contract/unsafe_contract.ts +3 -3
  121. package/src/deployment/broadcast_function.ts +3 -3
  122. package/src/deployment/contract_deployer.ts +4 -4
  123. package/src/deployment/deploy_instance.ts +3 -3
  124. package/src/deployment/protocol_contracts.ts +1 -1
  125. package/src/deployment/register_class.ts +3 -3
  126. package/src/entrypoint/default_entrypoint.ts +2 -2
  127. package/src/entrypoint/entrypoint.ts +3 -3
  128. package/src/fee/fee_payment_method.ts +3 -3
  129. package/src/fee/native_fee_payment_method.ts +5 -10
  130. package/src/fee/private_fee_payment_method.ts +4 -4
  131. package/src/fee/public_fee_payment_method.ts +4 -4
  132. package/src/index.ts +2 -0
  133. package/src/rpc_clients/pxe_client.ts +4 -3
  134. package/src/utils/abi_types.ts +1 -1
  135. package/src/utils/account.ts +2 -2
  136. package/src/utils/authwit.ts +4 -10
  137. package/src/utils/cheat_codes.ts +3 -3
  138. package/src/utils/l1_contracts.ts +1 -1
  139. package/src/utils/pub_key.ts +1 -1
  140. package/src/utils/pxe.ts +2 -2
  141. package/src/wallet/account_wallet.ts +5 -5
  142. package/src/wallet/account_wallet_with_private_key.ts +4 -4
  143. package/src/wallet/base_wallet.ts +27 -21
  144. package/src/wallet/create_recipient.ts +1 -1
  145. package/src/wallet/index.ts +3 -3
  146. package/src/wallet/signerless_wallet.ts +3 -3
@@ -1,7 +1,7 @@
1
- import { CompleteAddress, PXE } from '@aztec/circuit-types';
1
+ import { type CompleteAddress, type PXE } from '@aztec/circuit-types';
2
2
  import { retryUntil } from '@aztec/foundation/retry';
3
3
 
4
- import { DefaultWaitOpts, WaitOpts } from '../contract/index.js';
4
+ import { DefaultWaitOpts, type WaitOpts } from '../contract/index.js';
5
5
 
6
6
  /**
7
7
  * Waits for the account to finish synchronizing with the PXE Service.
@@ -1,5 +1,5 @@
1
- import { FunctionCall, PackedArguments } from '@aztec/circuit-types';
2
- import { AztecAddress, Fr, GeneratorIndex } from '@aztec/circuits.js';
1
+ import { type FunctionCall, PackedArguments } from '@aztec/circuit-types';
2
+ import { type AztecAddress, type Fr, GeneratorIndex } from '@aztec/circuits.js';
3
3
  import { pedersenHash } from '@aztec/foundation/crypto';
4
4
 
5
5
  // docs:start:authwit_computeAuthWitMessageHash
@@ -40,10 +40,7 @@ export const computeAuthWitMessageHash = (caller: AztecAddress, chainId: Fr, ver
40
40
  * @returns The inner hash for the witness
41
41
  */
42
42
  export const computeInnerAuthWitHash = (args: Fr[]) => {
43
- return pedersenHash(
44
- args.map(fr => fr.toBuffer()),
45
- GeneratorIndex.AUTHWIT_INNER,
46
- );
43
+ return pedersenHash(args, GeneratorIndex.AUTHWIT_INNER);
47
44
  };
48
45
 
49
46
  /**
@@ -61,8 +58,5 @@ export const computeInnerAuthWitHash = (args: Fr[]) => {
61
58
  * @returns The outer hash for the witness
62
59
  */
63
60
  export const computeOuterAuthWitHash = (consumer: AztecAddress, chainId: Fr, version: Fr, innerHash: Fr) => {
64
- return pedersenHash(
65
- [consumer.toField(), chainId, version, innerHash].map(fr => fr.toBuffer()),
66
- GeneratorIndex.AUTHWIT_OUTER,
67
- );
61
+ return pedersenHash([consumer.toField(), chainId, version, innerHash], GeneratorIndex.AUTHWIT_OUTER);
68
62
  };
@@ -1,5 +1,5 @@
1
- import { Note, PXE } from '@aztec/circuit-types';
2
- import { AztecAddress, EthAddress, Fr } from '@aztec/circuits.js';
1
+ import { type Note, type PXE } from '@aztec/circuit-types';
2
+ import { type AztecAddress, type EthAddress, Fr } from '@aztec/circuits.js';
3
3
  import { toBigIntBE, toHex } from '@aztec/foundation/bigint-buffer';
4
4
  import { keccak, pedersenHash } from '@aztec/foundation/crypto';
5
5
  import { createDebugLogger } from '@aztec/foundation/log';
@@ -246,7 +246,7 @@ export class AztecCheatCodes {
246
246
  public computeSlotInMap(baseSlot: Fr | bigint, key: Fr | bigint | AztecAddress): Fr {
247
247
  // Based on `at` function in
248
248
  // aztec3-packages/aztec-nr/aztec/src/state_vars/map.nr
249
- return pedersenHash([new Fr(baseSlot), new Fr(key)].map(f => f.toBuffer()));
249
+ return pedersenHash([new Fr(baseSlot), new Fr(key)]);
250
250
  }
251
251
 
252
252
  /**
@@ -1,4 +1,4 @@
1
- import { L1ContractAddresses } from '@aztec/ethereum';
1
+ import { type L1ContractAddresses } from '@aztec/ethereum';
2
2
  import { retryUntil } from '@aztec/foundation/retry';
3
3
 
4
4
  import { createPXEClient } from '../rpc_clients/index.js';
@@ -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
 
@@ -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,33 @@
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 SyncStatus,
11
+ type Tx,
12
+ type TxEffect,
13
+ type TxExecutionRequest,
14
+ type TxHash,
15
+ type TxReceipt,
16
16
  } 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';
17
+ import {
18
+ type AztecAddress,
19
+ type CompleteAddress,
20
+ type Fr,
21
+ type GrumpkinPrivateKey,
22
+ type PartialAddress,
23
+ } from '@aztec/circuits.js';
24
+ import { type ContractArtifact } from '@aztec/foundation/abi';
25
+ import { type ContractClassWithId, type ContractInstanceWithAddress } from '@aztec/types/contracts';
26
+ import { type NodeInfo } from '@aztec/types/interfaces';
21
27
 
22
- import { Wallet } from '../account/wallet.js';
23
- import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
24
- import { FeeOptions } from '../entrypoint/entrypoint.js';
28
+ import { type Wallet } from '../account/wallet.js';
29
+ import { type ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
30
+ import { type FeeOptions } from '../entrypoint/entrypoint.js';
25
31
 
26
32
  /**
27
33
  * A base class for Wallet implementations
@@ -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
  /**