@aztec/aztec.js 0.28.0 → 0.29.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 (54) hide show
  1. package/dest/account/interface.d.ts +17 -6
  2. package/dest/account/interface.d.ts.map +1 -1
  3. package/dest/account/interface.js +1 -1
  4. package/dest/account_manager/index.d.ts.map +1 -1
  5. package/dest/account_manager/index.js +2 -1
  6. package/dest/contract/deploy_method.d.ts.map +1 -1
  7. package/dest/contract/deploy_method.js +4 -3
  8. package/dest/deployment/deploy_instance.d.ts +1 -4
  9. package/dest/deployment/deploy_instance.d.ts.map +1 -1
  10. package/dest/deployment/deploy_instance.js +9 -6
  11. package/dest/fee/native_fee_payment_method.js +3 -3
  12. package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
  13. package/dest/fee/private_fee_payment_method.js +4 -4
  14. package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
  15. package/dest/fee/public_fee_payment_method.js +4 -4
  16. package/dest/index.d.ts +4 -3
  17. package/dest/index.d.ts.map +1 -1
  18. package/dest/index.js +5 -4
  19. package/dest/rpc_clients/pxe_client.d.ts.map +1 -1
  20. package/dest/rpc_clients/pxe_client.js +2 -4
  21. package/dest/utils/authwit.d.ts +2 -2
  22. package/dest/utils/authwit.d.ts.map +1 -1
  23. package/dest/utils/authwit.js +6 -6
  24. package/dest/utils/index.d.ts +0 -1
  25. package/dest/utils/index.d.ts.map +1 -1
  26. package/dest/utils/index.js +1 -2
  27. package/dest/wallet/account_wallet.d.ts +36 -8
  28. package/dest/wallet/account_wallet.d.ts.map +1 -1
  29. package/dest/wallet/account_wallet.js +36 -9
  30. package/dest/wallet/base_wallet.d.ts +11 -4
  31. package/dest/wallet/base_wallet.d.ts.map +1 -1
  32. package/dest/wallet/base_wallet.js +7 -7
  33. package/dest/wallet/signerless_wallet.d.ts +1 -1
  34. package/dest/wallet/signerless_wallet.d.ts.map +1 -1
  35. package/dest/wallet/signerless_wallet.js +2 -2
  36. package/package.json +7 -7
  37. package/src/account/interface.ts +22 -6
  38. package/src/account_manager/index.ts +1 -0
  39. package/src/contract/deploy_method.ts +2 -1
  40. package/src/deployment/deploy_instance.ts +11 -10
  41. package/src/fee/native_fee_payment_method.ts +2 -2
  42. package/src/fee/private_fee_payment_method.ts +2 -9
  43. package/src/fee/public_fee_payment_method.ts +1 -5
  44. package/src/index.ts +1 -4
  45. package/src/rpc_clients/pxe_client.ts +0 -4
  46. package/src/utils/authwit.ts +5 -5
  47. package/src/utils/index.ts +0 -1
  48. package/src/wallet/account_wallet.ts +76 -9
  49. package/src/wallet/base_wallet.ts +18 -9
  50. package/src/wallet/signerless_wallet.ts +1 -1
  51. package/dest/utils/l2_contracts.d.ts +0 -10
  52. package/dest/utils/l2_contracts.d.ts.map +0 -1
  53. package/dest/utils/l2_contracts.js +0 -10
  54. package/src/utils/l2_contracts.ts +0 -12
@@ -1,8 +1,6 @@
1
1
  import {
2
2
  AuthWitness,
3
- ContractData,
4
3
  DeployedContract,
5
- ExtendedContractData,
6
4
  ExtendedNote,
7
5
  FunctionCall,
8
6
  GetUnencryptedLogsResponse,
@@ -23,6 +21,7 @@ import { NodeInfo } from '@aztec/types/interfaces';
23
21
 
24
22
  import { FeeOptions } from '../account/interface.js';
25
23
  import { Wallet } from '../account/wallet.js';
24
+ import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
26
25
 
27
26
  /**
28
27
  * A base class for Wallet implementations
@@ -34,8 +33,21 @@ export abstract class BaseWallet implements Wallet {
34
33
 
35
34
  abstract createTxExecutionRequest(execs: FunctionCall[], fee?: FeeOptions): Promise<TxExecutionRequest>;
36
35
 
37
- abstract createAuthWitness(message: Fr): Promise<AuthWitness>;
36
+ abstract createAuthWit(
37
+ messageHashOrIntent:
38
+ | Fr
39
+ | Buffer
40
+ | {
41
+ /** The caller to approve */
42
+ caller: AztecAddress;
43
+ /** The action to approve */
44
+ action: ContractFunctionInteraction | FunctionCall;
45
+ },
46
+ ): Promise<AuthWitness>;
38
47
 
48
+ getAddress() {
49
+ return this.getCompleteAddress().address;
50
+ }
39
51
  getContractInstance(address: AztecAddress): Promise<ContractInstanceWithAddress | undefined> {
40
52
  return this.pxe.getContractInstance(address);
41
53
  }
@@ -100,12 +112,6 @@ export abstract class BaseWallet implements Wallet {
100
112
  viewTx(functionName: string, args: any[], to: AztecAddress, from?: AztecAddress | undefined): Promise<any> {
101
113
  return this.pxe.viewTx(functionName, args, to, from);
102
114
  }
103
- getExtendedContractData(contractAddress: AztecAddress): Promise<ExtendedContractData | undefined> {
104
- return this.pxe.getExtendedContractData(contractAddress);
105
- }
106
- getContractData(contractAddress: AztecAddress): Promise<ContractData | undefined> {
107
- return this.pxe.getContractData(contractAddress);
108
- }
109
115
  getUnencryptedLogs(filter: LogFilter): Promise<GetUnencryptedLogsResponse> {
110
116
  return this.pxe.getUnencryptedLogs(filter);
111
117
  }
@@ -130,4 +136,7 @@ export abstract class BaseWallet implements Wallet {
130
136
  isContractClassPubliclyRegistered(id: Fr): Promise<boolean> {
131
137
  return this.pxe.isContractClassPubliclyRegistered(id);
132
138
  }
139
+ isContractPubliclyDeployed(address: AztecAddress): Promise<boolean> {
140
+ return this.pxe.isContractPubliclyDeployed(address);
141
+ }
133
142
  }
@@ -31,7 +31,7 @@ export class SignerlessWallet extends BaseWallet {
31
31
  throw new Error('Method not implemented.');
32
32
  }
33
33
 
34
- createAuthWitness(_message: Fr): Promise<AuthWitness> {
34
+ createAuthWit(_message: Fr): Promise<AuthWitness> {
35
35
  throw new Error('Method not implemented.');
36
36
  }
37
37
  }
@@ -1,10 +0,0 @@
1
- import { PXE } from '@aztec/circuit-types';
2
- import { AztecAddress } from '@aztec/foundation/aztec-address';
3
- /**
4
- * Checks whether a give contract is deployed on the network.
5
- * @param pxe - The PXE to use to obtain the information.
6
- * @param contractAddress - The address of the contract to check.
7
- * @returns A flag indicating whether the contract is deployed.
8
- */
9
- export declare function isContractDeployed(pxe: PXE, contractAddress: AztecAddress): Promise<boolean>;
10
- //# sourceMappingURL=l2_contracts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"l2_contracts.d.ts","sourceRoot":"","sources":["../../src/utils/l2_contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAElG"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Checks whether a give contract is deployed on the network.
3
- * @param pxe - The PXE to use to obtain the information.
4
- * @param contractAddress - The address of the contract to check.
5
- * @returns A flag indicating whether the contract is deployed.
6
- */
7
- export async function isContractDeployed(pxe, contractAddress) {
8
- return !!(await pxe.getContractData(contractAddress)) || !!(await pxe.getContractInstance(contractAddress));
9
- }
10
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibDJfY29udHJhY3RzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWxzL2wyX2NvbnRyYWN0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHQTs7Ozs7R0FLRztBQUNILE1BQU0sQ0FBQyxLQUFLLFVBQVUsa0JBQWtCLENBQUMsR0FBUSxFQUFFLGVBQTZCO0lBQzlFLE9BQU8sQ0FBQyxDQUFDLENBQUMsTUFBTSxHQUFHLENBQUMsZUFBZSxDQUFDLGVBQWUsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsTUFBTSxHQUFHLENBQUMsbUJBQW1CLENBQUMsZUFBZSxDQUFDLENBQUMsQ0FBQztBQUM5RyxDQUFDIn0=
@@ -1,12 +0,0 @@
1
- import { PXE } from '@aztec/circuit-types';
2
- import { AztecAddress } from '@aztec/foundation/aztec-address';
3
-
4
- /**
5
- * Checks whether a give contract is deployed on the network.
6
- * @param pxe - The PXE to use to obtain the information.
7
- * @param contractAddress - The address of the contract to check.
8
- * @returns A flag indicating whether the contract is deployed.
9
- */
10
- export async function isContractDeployed(pxe: PXE, contractAddress: AztecAddress): Promise<boolean> {
11
- return !!(await pxe.getContractData(contractAddress)) || !!(await pxe.getContractInstance(contractAddress));
12
- }