@aztec/aztec.js 0.28.1 → 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.
- package/dest/account/interface.d.ts +17 -6
- package/dest/account/interface.d.ts.map +1 -1
- package/dest/account/interface.js +1 -1
- package/dest/account_manager/index.d.ts.map +1 -1
- package/dest/account_manager/index.js +2 -1
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +4 -3
- package/dest/deployment/deploy_instance.d.ts +1 -4
- package/dest/deployment/deploy_instance.d.ts.map +1 -1
- package/dest/deployment/deploy_instance.js +9 -6
- package/dest/fee/native_fee_payment_method.js +3 -3
- package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/private_fee_payment_method.js +4 -4
- package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/public_fee_payment_method.js +4 -4
- package/dest/index.d.ts +4 -3
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +5 -4
- package/dest/rpc_clients/pxe_client.d.ts.map +1 -1
- package/dest/rpc_clients/pxe_client.js +2 -4
- package/dest/utils/authwit.d.ts +2 -2
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +6 -6
- package/dest/utils/index.d.ts +0 -1
- package/dest/utils/index.d.ts.map +1 -1
- package/dest/utils/index.js +1 -2
- package/dest/wallet/account_wallet.d.ts +36 -8
- package/dest/wallet/account_wallet.d.ts.map +1 -1
- package/dest/wallet/account_wallet.js +36 -9
- package/dest/wallet/base_wallet.d.ts +11 -4
- package/dest/wallet/base_wallet.d.ts.map +1 -1
- package/dest/wallet/base_wallet.js +7 -7
- package/dest/wallet/signerless_wallet.d.ts +1 -1
- package/dest/wallet/signerless_wallet.d.ts.map +1 -1
- package/dest/wallet/signerless_wallet.js +2 -2
- package/package.json +7 -7
- package/src/account/interface.ts +22 -6
- package/src/account_manager/index.ts +1 -0
- package/src/contract/deploy_method.ts +2 -1
- package/src/deployment/deploy_instance.ts +11 -10
- package/src/fee/native_fee_payment_method.ts +2 -2
- package/src/fee/private_fee_payment_method.ts +2 -9
- package/src/fee/public_fee_payment_method.ts +1 -5
- package/src/index.ts +1 -4
- package/src/rpc_clients/pxe_client.ts +0 -4
- package/src/utils/authwit.ts +5 -5
- package/src/utils/index.ts +0 -1
- package/src/wallet/account_wallet.ts +76 -9
- package/src/wallet/base_wallet.ts +18 -9
- package/src/wallet/signerless_wallet.ts +1 -1
- package/dest/utils/l2_contracts.d.ts +0 -10
- package/dest/utils/l2_contracts.d.ts.map +0 -1
- package/dest/utils/l2_contracts.js +0 -10
- 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
|
|
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
|
-
|
|
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
|
-
}
|