@aztec/aztec.js 0.73.0 → 0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2
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/README.md +1 -1
- package/dest/account/contract.js +5 -3
- package/dest/account/index.js +8 -2
- package/dest/account/interface.js +4 -3
- package/dest/account/wallet.js +3 -2
- package/dest/account_manager/deploy_account_method.js +22 -25
- package/dest/account_manager/deploy_account_sent_tx.js +16 -17
- package/dest/account_manager/index.js +67 -78
- package/dest/api/abi.js +0 -1
- package/dest/api/account.js +0 -1
- package/dest/api/addresses.js +0 -1
- package/dest/api/cheat_codes.js +25 -0
- package/dest/api/deployment.js +0 -1
- package/dest/api/entrypoint.js +0 -1
- package/dest/api/eth_address.js +0 -1
- package/dest/api/ethereum/anvil_test_watcher.js +113 -0
- package/dest/api/ethereum/chain_monitor.js +69 -0
- package/dest/api/ethereum/cheat_codes.js +142 -0
- package/dest/api/ethereum/index.js +6 -0
- package/dest/api/ethereum/l1_contracts.js +13 -0
- package/dest/api/ethereum/portal_manager.js +284 -0
- package/dest/api/fee.js +0 -1
- package/dest/api/fields.js +0 -1
- package/dest/api/interfaces/pxe.js +1 -2
- package/dest/api/log.js +1 -0
- package/dest/api/log_id.js +0 -1
- package/dest/api/tx_hash.js +0 -1
- package/dest/api/wallet.js +1 -2
- package/dest/contract/base_contract_interaction.js +75 -52
- package/dest/contract/batch_call.js +57 -39
- package/dest/contract/checker.js +29 -20
- package/dest/contract/contract.js +22 -27
- package/dest/contract/contract_base.js +21 -30
- package/dest/contract/contract_function_interaction.js +48 -48
- package/dest/contract/deploy_method.js +99 -84
- package/dest/contract/deploy_proven_tx.js +8 -11
- package/dest/contract/deploy_sent_tx.js +19 -22
- package/dest/contract/get_gas_limits.js +2 -4
- package/dest/contract/index.js +4 -6
- package/dest/contract/proven_tx.js +7 -10
- package/dest/contract/sent_tx.js +32 -34
- package/dest/contract/unsafe_contract.js +2 -10
- package/dest/deployment/broadcast_function.js +28 -26
- package/dest/deployment/contract_deployer.js +15 -14
- package/dest/deployment/deploy_instance.js +1 -3
- package/dest/deployment/index.js +0 -1
- package/dest/deployment/protocol_contracts.js +2 -5
- package/dest/deployment/register_class.js +8 -8
- package/dest/entrypoint/default_entrypoint.js +8 -5
- package/dest/entrypoint/default_multi_call_entrypoint.js +66 -23
- package/dest/entrypoint/entrypoint.js +0 -1
- package/dest/entrypoint/payload.js +73 -82
- package/dest/fee/fee_juice_payment_method.js +3 -4
- package/dest/fee/fee_juice_payment_method_with_claim.js +11 -14
- package/dest/fee/fee_payment_method.js +3 -2
- package/dest/fee/no_fee_payment_method.js +2 -4
- package/dest/fee/private_fee_payment_method.js +36 -34
- package/dest/fee/public_fee_payment_method.js +34 -31
- package/dest/index.js +8 -9
- package/dest/rpc_clients/index.js +0 -1
- package/dest/rpc_clients/node/index.js +30 -16
- package/dest/rpc_clients/pxe_client.js +5 -3
- package/dest/utils/abi_types.js +1 -2
- package/dest/utils/authwit.js +15 -15
- package/dest/utils/aztec_cheatcodes.js +62 -0
- package/dest/utils/field_compressed_string.js +2 -4
- package/dest/utils/index.js +5 -12
- package/dest/utils/node.js +4 -5
- package/dest/utils/pub_key.js +1 -3
- package/dest/utils/pxe.js +3 -5
- package/dest/wallet/account_wallet.js +118 -81
- package/dest/wallet/account_wallet_with_private_key.js +9 -15
- package/dest/wallet/base_wallet.js +7 -5
- package/dest/wallet/index.js +2 -4
- package/dest/wallet/signerless_wallet.js +4 -6
- package/package.json +14 -17
- package/src/api/account.ts +7 -1
- package/src/api/cheat_codes.ts +35 -0
- package/src/{utils → api/ethereum}/anvil_test_watcher.ts +2 -1
- package/src/{utils → api/ethereum}/cheat_codes.ts +6 -109
- package/src/api/ethereum/index.ts +15 -0
- package/src/{utils → api/ethereum}/l1_contracts.ts +1 -1
- package/src/{utils → api/ethereum}/portal_manager.ts +4 -9
- package/src/api/interfaces/pxe.ts +1 -1
- package/src/api/log.ts +1 -0
- package/src/api/wallet.ts +1 -1
- package/src/contract/contract_function_interaction.ts +1 -1
- package/src/contract/index.ts +2 -2
- package/src/entrypoint/default_multi_call_entrypoint.ts +2 -1
- package/src/entrypoint/entrypoint.ts +1 -1
- package/src/fee/fee_juice_payment_method_with_claim.ts +1 -1
- package/src/index.ts +7 -35
- package/src/utils/aztec_cheatcodes.ts +75 -0
- package/src/utils/index.ts +19 -11
- package/src/utils/node.ts +2 -0
- package/src/wallet/index.ts +1 -1
- package/dest/account/contract.d.ts +0 -33
- package/dest/account/contract.d.ts.map +0 -1
- package/dest/account/index.d.ts +0 -15
- package/dest/account/index.d.ts.map +0 -1
- package/dest/account/interface.d.ts +0 -30
- package/dest/account/interface.d.ts.map +0 -1
- package/dest/account/wallet.d.ts +0 -10
- package/dest/account/wallet.d.ts.map +0 -1
- package/dest/account_manager/deploy_account_method.d.ts +0 -15
- package/dest/account_manager/deploy_account_method.d.ts.map +0 -1
- package/dest/account_manager/deploy_account_sent_tx.d.ts +0 -29
- package/dest/account_manager/deploy_account_sent_tx.d.ts.map +0 -1
- package/dest/account_manager/index.d.ts +0 -99
- package/dest/account_manager/index.d.ts.map +0 -1
- package/dest/api/abi.d.ts +0 -4
- package/dest/api/abi.d.ts.map +0 -1
- package/dest/api/account.d.ts +0 -4
- package/dest/api/account.d.ts.map +0 -1
- package/dest/api/addresses.d.ts +0 -3
- package/dest/api/addresses.d.ts.map +0 -1
- package/dest/api/deployment.d.ts +0 -4
- package/dest/api/deployment.d.ts.map +0 -1
- package/dest/api/entrypoint.d.ts +0 -2
- package/dest/api/entrypoint.d.ts.map +0 -1
- package/dest/api/eth_address.d.ts +0 -2
- package/dest/api/eth_address.d.ts.map +0 -1
- package/dest/api/ethereum.d.ts +0 -3
- package/dest/api/ethereum.d.ts.map +0 -1
- package/dest/api/ethereum.js +0 -3
- package/dest/api/fee.d.ts +0 -7
- package/dest/api/fee.d.ts.map +0 -1
- package/dest/api/fields.d.ts +0 -2
- package/dest/api/fields.d.ts.map +0 -1
- package/dest/api/interfaces/pxe.d.ts +0 -2
- package/dest/api/interfaces/pxe.d.ts.map +0 -1
- package/dest/api/log_id.d.ts +0 -2
- package/dest/api/log_id.d.ts.map +0 -1
- package/dest/api/tx_hash.d.ts +0 -2
- package/dest/api/tx_hash.d.ts.map +0 -1
- package/dest/api/wallet.d.ts +0 -2
- package/dest/api/wallet.d.ts.map +0 -1
- package/dest/barretenberg-threads.wasm.gz +0 -0
- package/dest/barretenberg.wasm.gz +0 -0
- package/dest/contract/base_contract_interaction.d.ts +0 -82
- package/dest/contract/base_contract_interaction.d.ts.map +0 -1
- package/dest/contract/batch_call.d.ts +0 -27
- package/dest/contract/batch_call.d.ts.map +0 -1
- package/dest/contract/checker.d.ts +0 -11
- package/dest/contract/checker.d.ts.map +0 -1
- package/dest/contract/contract.d.ts +0 -41
- package/dest/contract/contract.d.ts.map +0 -1
- package/dest/contract/contract_base.d.ts +0 -61
- package/dest/contract/contract_base.d.ts.map +0 -1
- package/dest/contract/contract_function_interaction.d.ts +0 -67
- package/dest/contract/contract_function_interaction.d.ts.map +0 -1
- package/dest/contract/deploy_method.d.ts +0 -110
- package/dest/contract/deploy_method.d.ts.map +0 -1
- package/dest/contract/deploy_proven_tx.d.ts +0 -19
- package/dest/contract/deploy_proven_tx.d.ts.map +0 -1
- package/dest/contract/deploy_sent_tx.d.ts +0 -43
- package/dest/contract/deploy_sent_tx.d.ts.map +0 -1
- package/dest/contract/get_gas_limits.d.ts +0 -18
- package/dest/contract/get_gas_limits.d.ts.map +0 -1
- package/dest/contract/index.d.ts +0 -45
- package/dest/contract/index.d.ts.map +0 -1
- package/dest/contract/proven_tx.d.ts +0 -16
- package/dest/contract/proven_tx.d.ts.map +0 -1
- package/dest/contract/sent_tx.d.ts +0 -60
- package/dest/contract/sent_tx.d.ts.map +0 -1
- package/dest/contract/unsafe_contract.d.ts +0 -15
- package/dest/contract/unsafe_contract.d.ts.map +0 -1
- package/dest/deployment/broadcast_function.d.ts +0 -24
- package/dest/deployment/broadcast_function.d.ts.map +0 -1
- package/dest/deployment/contract_deployer.d.ts +0 -27
- package/dest/deployment/contract_deployer.d.ts.map +0 -1
- package/dest/deployment/deploy_instance.d.ts +0 -10
- package/dest/deployment/deploy_instance.d.ts.map +0 -1
- package/dest/deployment/index.d.ts +0 -2
- package/dest/deployment/index.d.ts.map +0 -1
- package/dest/deployment/protocol_contracts.d.ts +0 -7
- package/dest/deployment/protocol_contracts.d.ts.map +0 -1
- package/dest/deployment/register_class.d.ts +0 -6
- package/dest/deployment/register_class.d.ts.map +0 -1
- package/dest/entrypoint/default_entrypoint.d.ts +0 -12
- package/dest/entrypoint/default_entrypoint.d.ts.map +0 -1
- package/dest/entrypoint/default_multi_call_entrypoint.d.ts +0 -15
- package/dest/entrypoint/default_multi_call_entrypoint.d.ts.map +0 -1
- package/dest/entrypoint/entrypoint.d.ts +0 -31
- package/dest/entrypoint/entrypoint.d.ts.map +0 -1
- package/dest/entrypoint/payload.d.ts +0 -125
- package/dest/entrypoint/payload.d.ts.map +0 -1
- package/dest/fee/fee_juice_payment_method.d.ts +0 -14
- package/dest/fee/fee_juice_payment_method.d.ts.map +0 -1
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts +0 -17
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +0 -1
- package/dest/fee/fee_payment_method.d.ts +0 -22
- package/dest/fee/fee_payment_method.d.ts.map +0 -1
- package/dest/fee/no_fee_payment_method.d.ts +0 -13
- package/dest/fee/no_fee_payment_method.d.ts.map +0 -1
- package/dest/fee/private_fee_payment_method.d.ts +0 -51
- package/dest/fee/private_fee_payment_method.d.ts.map +0 -1
- package/dest/fee/public_fee_payment_method.d.ts +0 -41
- package/dest/fee/public_fee_payment_method.d.ts.map +0 -1
- package/dest/index.d.ts +0 -51
- package/dest/index.d.ts.map +0 -1
- package/dest/main.js +0 -2
- package/dest/main.js.LICENSE.txt +0 -25
- package/dest/rpc_clients/index.d.ts +0 -3
- package/dest/rpc_clients/index.d.ts.map +0 -1
- package/dest/rpc_clients/node/index.d.ts +0 -11
- package/dest/rpc_clients/node/index.d.ts.map +0 -1
- package/dest/rpc_clients/pxe_client.d.ts +0 -9
- package/dest/rpc_clients/pxe_client.d.ts.map +0 -1
- package/dest/utils/abi_types.d.ts +0 -26
- package/dest/utils/abi_types.d.ts.map +0 -1
- package/dest/utils/anvil_test_watcher.d.ts +0 -28
- package/dest/utils/anvil_test_watcher.d.ts.map +0 -1
- package/dest/utils/anvil_test_watcher.js +0 -108
- package/dest/utils/authwit.d.ts +0 -59
- package/dest/utils/authwit.d.ts.map +0 -1
- package/dest/utils/chain_monitor.d.ts +0 -21
- package/dest/utils/chain_monitor.d.ts.map +0 -1
- package/dest/utils/chain_monitor.js +0 -58
- package/dest/utils/cheat_codes.d.ts +0 -137
- package/dest/utils/cheat_codes.d.ts.map +0 -1
- package/dest/utils/cheat_codes.js +0 -225
- package/dest/utils/field_compressed_string.d.ts +0 -17
- package/dest/utils/field_compressed_string.d.ts.map +0 -1
- package/dest/utils/index.d.ts +0 -12
- package/dest/utils/index.d.ts.map +0 -1
- package/dest/utils/l1_contracts.d.ts +0 -3
- package/dest/utils/l1_contracts.d.ts.map +0 -1
- package/dest/utils/l1_contracts.js +0 -15
- package/dest/utils/node.d.ts +0 -4
- package/dest/utils/node.d.ts.map +0 -1
- package/dest/utils/portal_manager.d.ts +0 -130
- package/dest/utils/portal_manager.d.ts.map +0 -1
- package/dest/utils/portal_manager.js +0 -265
- package/dest/utils/pub_key.d.ts +0 -8
- package/dest/utils/pub_key.d.ts.map +0 -1
- package/dest/utils/pxe.d.ts +0 -4
- package/dest/utils/pxe.d.ts.map +0 -1
- package/dest/wallet/account_wallet.d.ts +0 -73
- package/dest/wallet/account_wallet.d.ts.map +0 -1
- package/dest/wallet/account_wallet_with_private_key.d.ts +0 -26
- package/dest/wallet/account_wallet_with_private_key.d.ts.map +0 -1
- package/dest/wallet/base_wallet.d.ts +0 -64
- package/dest/wallet/base_wallet.d.ts.map +0 -1
- package/dest/wallet/index.d.ts +0 -17
- package/dest/wallet/index.d.ts.map +0 -1
- package/dest/wallet/signerless_wallet.d.ts +0 -22
- package/dest/wallet/signerless_wallet.d.ts.map +0 -1
- package/src/api/ethereum.ts +0 -2
- /package/src/{utils → api/ethereum}/chain_monitor.ts +0 -0
|
@@ -4,25 +4,19 @@ import { AccountWallet } from './account_wallet.js';
|
|
|
4
4
|
* Extends {@link AccountWallet} with the encryption private key. Not required for
|
|
5
5
|
* implementing the wallet interface but useful for testing purposes or exporting
|
|
6
6
|
* an account to another pxe.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/** Deployment salt for this account contract. */
|
|
11
|
-
|
|
12
|
-
super(pxe, account);
|
|
13
|
-
this.secretKey = secretKey;
|
|
14
|
-
this.salt = salt;
|
|
7
|
+
*/ export class AccountWalletWithSecretKey extends AccountWallet {
|
|
8
|
+
secretKey;
|
|
9
|
+
salt;
|
|
10
|
+
constructor(pxe, account, secretKey, /** Deployment salt for this account contract. */ salt){
|
|
11
|
+
super(pxe, account), this.secretKey = secretKey, this.salt = salt;
|
|
15
12
|
}
|
|
16
|
-
/** Returns the encryption private key associated with this account. */
|
|
17
|
-
getSecretKey() {
|
|
13
|
+
/** Returns the encryption private key associated with this account. */ getSecretKey() {
|
|
18
14
|
return this.secretKey;
|
|
19
15
|
}
|
|
20
16
|
/** Returns the encryption secret, the secret of the encryption point—the point that others use to encrypt messages to this account
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
async getEncryptionSecret() {
|
|
17
|
+
* note - this ensures that the address secret always corresponds to an address point with y being positive
|
|
18
|
+
* dev - this is also referred to as the address secret, which decrypts payloads encrypted to an address point
|
|
19
|
+
*/ async getEncryptionSecret() {
|
|
25
20
|
return computeAddressSecret(await this.getCompleteAddress().getPreaddress(), deriveMasterIncomingViewingSecretKey(this.getSecretKey()));
|
|
26
21
|
}
|
|
27
22
|
}
|
|
28
|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5
|
-
|
|
3
|
+
*/ export class BaseWallet {
|
|
4
|
+
pxe;
|
|
5
|
+
scopes;
|
|
6
|
+
constructor(pxe, scopes){
|
|
6
7
|
this.pxe = pxe;
|
|
7
8
|
this.scopes = scopes;
|
|
8
9
|
}
|
|
@@ -108,7 +109,9 @@ export class BaseWallet {
|
|
|
108
109
|
getContractMetadata(address) {
|
|
109
110
|
return this.pxe.getContractMetadata(address);
|
|
110
111
|
}
|
|
111
|
-
getPrivateEvents(event, from, limit, vpks = [
|
|
112
|
+
getPrivateEvents(event, from, limit, vpks = [
|
|
113
|
+
this.getCompleteAddress().publicKeys.masterIncomingViewingPublicKey
|
|
114
|
+
]) {
|
|
112
115
|
return this.pxe.getPrivateEvents(event, from, limit, vpks);
|
|
113
116
|
}
|
|
114
117
|
getPublicEvents(event, from, limit) {
|
|
@@ -121,4 +124,3 @@ export class BaseWallet {
|
|
|
121
124
|
return this.pxe.getL2ToL1MembershipWitness(blockNumber, l2Tol1Message);
|
|
122
125
|
}
|
|
123
126
|
}
|
|
124
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZV93YWxsZXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvd2FsbGV0L2Jhc2Vfd2FsbGV0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXdDQTs7R0FFRztBQUNILE1BQU0sT0FBZ0IsVUFBVTtJQUM5QixZQUErQixHQUFRLEVBQVUsTUFBdUI7UUFBekMsUUFBRyxHQUFILEdBQUcsQ0FBSztRQUFVLFdBQU0sR0FBTixNQUFNLENBQWlCO0lBQUcsQ0FBQztJQWM1RSxTQUFTLENBQUMsTUFBc0I7UUFDOUIsSUFBSSxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUM7SUFDdkIsQ0FBQztJQUVELFNBQVM7UUFDUCxPQUFPLElBQUksQ0FBQyxNQUFNLENBQUM7SUFDckIsQ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FVBQVUsQ0FBQyw4QkFBOEIsQ0FBQztRQUVyRixPQUFPLElBQUksQ0FBQyxHQUFHLENBQUMsZ0JBQWdCLENBQUMsS0FBSyxFQUFFLElBQUksRUFBRSxLQUFLLEVBQUUsSUFBSSxDQUFDLENBQUM7SUFDN0QsQ0FBQztJQUNELGVBQWUsQ0FBSSxLQUE4QixFQUFFLElBQVksRUFBRSxLQUFhO1FBQzVFLE9BQU8sSUFBSSxDQUFDLEdBQUcsQ0FBQyxlQUFlLENBQUMsS0FBSyxFQUFFLElBQUksRUFBRSxLQUFLLENBQUMsQ0FBQztJQUN0RCxDQUFDO0lBQ00sMEJBQTBCLENBQy9CLGVBQTZCLEVBQzdCLFdBQWUsRUFDZixNQUFVO1FBRVYsT0FBTyxJQUFJLENBQUMsR0FBRyxDQUFDLDBCQUEwQixDQUFDLGVBQWUsRUFBRSxXQUFXLEVBQUUsTUFBTSxDQUFDLENBQUM7SUFDbkYsQ0FBQztJQUNELDBCQUEwQixDQUFDLFdBQW1CLEVBQUUsYUFBaUI7UUFDL0QsT0FBTyxJQUFJLENBQUMsR0FBRyxDQUFDLDBCQUEwQixDQUFDLFdBQVcsRUFBRSxhQUFhLENBQUMsQ0FBQztJQUN6RSxDQUFDO0NBQ0YifQ==
|
package/dest/wallet/index.js
CHANGED
|
@@ -9,9 +9,8 @@ export * from './signerless_wallet.js';
|
|
|
9
9
|
* @param address - Address for the account.
|
|
10
10
|
* @param accountContract - Account contract implementation.
|
|
11
11
|
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
const completeAddress = (await pxe.getRegisteredAccounts()).find(completeAddress => completeAddress.address.equals(address));
|
|
12
|
+
*/ export async function getWallet(pxe, address, accountContract) {
|
|
13
|
+
const completeAddress = (await pxe.getRegisteredAccounts()).find((completeAddress)=>completeAddress.address.equals(address));
|
|
15
14
|
if (!completeAddress) {
|
|
16
15
|
throw new Error(`Account ${address} not found`);
|
|
17
16
|
}
|
|
@@ -19,4 +18,3 @@ export async function getWallet(pxe, address, accountContract) {
|
|
|
19
18
|
const entrypoint = accountContract.getInterface(completeAddress, nodeInfo);
|
|
20
19
|
return new AccountWallet(pxe, entrypoint);
|
|
21
20
|
}
|
|
22
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvd2FsbGV0L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUlBLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUVwRCxjQUFjLHNCQUFzQixDQUFDO0FBQ3JDLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsY0FBYyxzQ0FBc0MsQ0FBQztBQUNyRCxjQUFjLHdCQUF3QixDQUFDO0FBRXZDOzs7Ozs7R0FNRztBQUNILE1BQU0sQ0FBQyxLQUFLLFVBQVUsU0FBUyxDQUM3QixHQUFRLEVBQ1IsT0FBcUIsRUFDckIsZUFBZ0M7SUFFaEMsTUFBTSxlQUFlLEdBQUcsQ0FBQyxNQUFNLEdBQUcsQ0FBQyxxQkFBcUIsRUFBRSxDQUFDLENBQUMsSUFBSSxDQUFDLGVBQWUsQ0FBQyxFQUFFLENBQ2pGLGVBQWUsQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxDQUN4QyxDQUFDO0lBQ0YsSUFBSSxDQUFDLGVBQWUsRUFBRSxDQUFDO1FBQ3JCLE1BQU0sSUFBSSxLQUFLLENBQUMsV0FBVyxPQUFPLFlBQVksQ0FBQyxDQUFDO0lBQ2xELENBQUM7SUFDRCxNQUFNLFFBQVEsR0FBRyxNQUFNLEdBQUcsQ0FBQyxXQUFXLEVBQUUsQ0FBQztJQUN6QyxNQUFNLFVBQVUsR0FBRyxlQUFlLENBQUMsWUFBWSxDQUFDLGVBQWUsRUFBRSxRQUFRLENBQUMsQ0FBQztJQUMzRSxPQUFPLElBQUksYUFBYSxDQUFDLEdBQUcsRUFBRSxVQUFVLENBQUMsQ0FBQztBQUM1QyxDQUFDIn0=
|
|
@@ -2,11 +2,10 @@ import { DefaultEntrypoint } from '../entrypoint/default_entrypoint.js';
|
|
|
2
2
|
import { BaseWallet } from './base_wallet.js';
|
|
3
3
|
/**
|
|
4
4
|
* Wallet implementation which creates a transaction request directly to the requested contract without any signing.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
constructor(pxe, entrypoint)
|
|
8
|
-
super(pxe);
|
|
9
|
-
this.entrypoint = entrypoint;
|
|
5
|
+
*/ export class SignerlessWallet extends BaseWallet {
|
|
6
|
+
entrypoint;
|
|
7
|
+
constructor(pxe, entrypoint){
|
|
8
|
+
super(pxe), this.entrypoint = entrypoint;
|
|
10
9
|
}
|
|
11
10
|
async createTxExecutionRequest(execution) {
|
|
12
11
|
let entrypoint = this.entrypoint;
|
|
@@ -35,4 +34,3 @@ export class SignerlessWallet extends BaseWallet {
|
|
|
35
34
|
return this.pxe.isL1ToL2MessageSynced(l1ToL2Message);
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2lnbmVybGVzc193YWxsZXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvd2FsbGV0L3NpZ25lcmxlc3Nfd2FsbGV0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdBLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHFDQUFxQyxDQUFDO0FBR3hFLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUU5Qzs7R0FFRztBQUNILE1BQU0sT0FBTyxnQkFBaUIsU0FBUSxVQUFVO0lBQzlDLFlBQVksR0FBUSxFQUFVLFVBQWd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sQ0FBQyxhQUFhLENBQUMsQ0FBQztJQUN2RCxDQUFDO0NBQ0YifQ==
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec.js",
|
|
3
3
|
"homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec.js",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./dest/index.js",
|
|
@@ -9,14 +9,15 @@
|
|
|
9
9
|
"./abi": "./dest/api/abi.js",
|
|
10
10
|
"./account": "./dest/api/account.js",
|
|
11
11
|
"./addresses": "./dest/api/addresses.js",
|
|
12
|
+
"./cheatcodes": "./dest/api/cheatcodes.js",
|
|
12
13
|
"./contracts": "./dest/contract/index.js",
|
|
13
14
|
"./deployment": "./dest/api/deployment.js",
|
|
14
15
|
"./entrypoint": "./dest/api/entrypoint.js",
|
|
15
16
|
"./eth_address": "./dest/api/eth_address.js",
|
|
16
|
-
"./ethereum": "./dest/api/ethereum.js",
|
|
17
|
+
"./ethereum": "./dest/api/ethereum/index.js",
|
|
17
18
|
"./fee": "./dest/api/fee.js",
|
|
18
19
|
"./fields": "./dest/api/fields.js",
|
|
19
|
-
"./
|
|
20
|
+
"./log": "./dest/api/log.js",
|
|
20
21
|
"./log_id": "./dest/api/log_id.js",
|
|
21
22
|
"./rpc": "./dest/rpc_clients/index.js",
|
|
22
23
|
"./tx_hash": "./dest/api/tx_hash.js",
|
|
@@ -31,14 +32,13 @@
|
|
|
31
32
|
"tsconfig": "./tsconfig.json"
|
|
32
33
|
},
|
|
33
34
|
"scripts": {
|
|
34
|
-
"build": "yarn clean && tsc -b
|
|
35
|
-
"build:web": "webpack",
|
|
35
|
+
"build": "yarn clean && tsc -b",
|
|
36
36
|
"build:dev": "tsc -b --watch",
|
|
37
37
|
"build:ts": "tsc -b",
|
|
38
38
|
"clean": "rm -rf ./dest .tsbuildinfo ./src/account_contract/artifacts",
|
|
39
39
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
|
|
40
40
|
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
|
|
41
|
-
"test": "
|
|
41
|
+
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
42
42
|
},
|
|
43
43
|
"inherits": [
|
|
44
44
|
"../package.common.json",
|
|
@@ -78,13 +78,13 @@
|
|
|
78
78
|
]
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@aztec/circuit-types": "0.
|
|
82
|
-
"@aztec/circuits.js": "0.
|
|
83
|
-
"@aztec/ethereum": "0.
|
|
84
|
-
"@aztec/foundation": "0.
|
|
85
|
-
"@aztec/l1-artifacts": "0.
|
|
86
|
-
"@aztec/protocol-contracts": "0.
|
|
87
|
-
"@aztec/types": "0.
|
|
81
|
+
"@aztec/circuit-types": "0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2",
|
|
82
|
+
"@aztec/circuits.js": "0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2",
|
|
83
|
+
"@aztec/ethereum": "0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2",
|
|
84
|
+
"@aztec/foundation": "0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2",
|
|
85
|
+
"@aztec/l1-artifacts": "0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2",
|
|
86
|
+
"@aztec/protocol-contracts": "0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2",
|
|
87
|
+
"@aztec/types": "0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2",
|
|
88
88
|
"axios": "^1.7.2",
|
|
89
89
|
"tslib": "^2.4.0",
|
|
90
90
|
"viem": "2.22.8"
|
|
@@ -94,7 +94,6 @@
|
|
|
94
94
|
"@types/jest": "^29.5.0",
|
|
95
95
|
"@types/node": "^18.7.23",
|
|
96
96
|
"buffer": "^6.0.3",
|
|
97
|
-
"copy-webpack-plugin": "^12.0.2",
|
|
98
97
|
"crypto-browserify": "^3.12.0",
|
|
99
98
|
"jest": "^29.5.0",
|
|
100
99
|
"jest-mock-extended": "^3.0.3",
|
|
@@ -104,9 +103,7 @@
|
|
|
104
103
|
"ts-loader": "^9.4.4",
|
|
105
104
|
"ts-node": "^10.9.1",
|
|
106
105
|
"typescript": "^5.0.4",
|
|
107
|
-
"util": "^0.12.5"
|
|
108
|
-
"webpack": "^5.88.2",
|
|
109
|
-
"webpack-cli": "^5.1.4"
|
|
106
|
+
"util": "^0.12.5"
|
|
110
107
|
},
|
|
111
108
|
"files": [
|
|
112
109
|
"dest",
|
package/src/api/account.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {
|
|
2
|
+
type AccountContract,
|
|
3
|
+
type AccountInterface,
|
|
4
|
+
type AuthWitnessProvider,
|
|
5
|
+
type Salt,
|
|
6
|
+
type Wallet,
|
|
7
|
+
} from '../account/index.js';
|
|
2
8
|
|
|
3
9
|
export { AccountManager } from '../account_manager/index.js';
|
|
4
10
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type PXE } from '@aztec/circuit-types';
|
|
2
|
+
import { EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes';
|
|
3
|
+
import { type L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
4
|
+
|
|
5
|
+
import { RollupCheatCodes } from '../index.js';
|
|
6
|
+
import { AztecCheatCodes } from '../utils/aztec_cheatcodes.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A class that provides utility functions for interacting with the chain.
|
|
10
|
+
*/
|
|
11
|
+
export class CheatCodes {
|
|
12
|
+
constructor(
|
|
13
|
+
/** Cheat codes for L1.*/
|
|
14
|
+
public eth: EthCheatCodes,
|
|
15
|
+
/** Cheat codes for Aztec L2. */
|
|
16
|
+
public aztec: AztecCheatCodes,
|
|
17
|
+
/** Cheat codes for the Aztec Rollup contract on L1. */
|
|
18
|
+
public rollup: RollupCheatCodes,
|
|
19
|
+
) {}
|
|
20
|
+
|
|
21
|
+
static async create(rpcUrl: string, pxe: PXE): Promise<CheatCodes> {
|
|
22
|
+
const ethCheatCodes = new EthCheatCodes(rpcUrl);
|
|
23
|
+
const aztecCheatCodes = new AztecCheatCodes(pxe);
|
|
24
|
+
const rollupCheatCodes = new RollupCheatCodes(
|
|
25
|
+
ethCheatCodes,
|
|
26
|
+
await pxe.getNodeInfo().then(n => n.l1ContractAddresses),
|
|
27
|
+
);
|
|
28
|
+
return new CheatCodes(ethCheatCodes, aztecCheatCodes, rollupCheatCodes);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static createRollup(rpcUrl: string, addresses: Pick<L1ContractAddresses, 'rollupAddress'>): RollupCheatCodes {
|
|
32
|
+
const ethCheatCodes = new EthCheatCodes(rpcUrl);
|
|
33
|
+
return new RollupCheatCodes(ethCheatCodes, addresses);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type EthCheatCodes, type Logger, createLogger } from '@aztec/aztec.js';
|
|
2
1
|
import { type EthAddress } from '@aztec/circuits.js';
|
|
2
|
+
import { type EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes';
|
|
3
|
+
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
3
4
|
import { RunningPromise } from '@aztec/foundation/running-promise';
|
|
4
5
|
import { type TestDateProvider } from '@aztec/foundation/timer';
|
|
5
6
|
import { RollupAbi } from '@aztec/l1-artifacts';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { type EpochProofClaim
|
|
2
|
-
import {
|
|
3
|
-
import { deriveStorageSlotInMap } from '@aztec/circuits.js/hash';
|
|
1
|
+
import { type EpochProofClaim } from '@aztec/circuit-types';
|
|
2
|
+
import { EthAddress } from '@aztec/circuits.js';
|
|
4
3
|
import { EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes';
|
|
5
4
|
import { type L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
6
5
|
import { createLogger } from '@aztec/foundation/log';
|
|
@@ -18,34 +17,7 @@ import {
|
|
|
18
17
|
} from 'viem';
|
|
19
18
|
import { foundry } from 'viem/chains';
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
* A class that provides utility functions for interacting with the chain.
|
|
23
|
-
*/
|
|
24
|
-
export class CheatCodes {
|
|
25
|
-
constructor(
|
|
26
|
-
/** Cheat codes for L1.*/
|
|
27
|
-
public eth: EthCheatCodes,
|
|
28
|
-
/** Cheat codes for Aztec L2. */
|
|
29
|
-
public aztec: AztecCheatCodes,
|
|
30
|
-
/** Cheat codes for the Aztec Rollup contract on L1. */
|
|
31
|
-
public rollup: RollupCheatCodes,
|
|
32
|
-
) {}
|
|
33
|
-
|
|
34
|
-
static async create(rpcUrl: string, pxe: PXE): Promise<CheatCodes> {
|
|
35
|
-
const ethCheatCodes = new EthCheatCodes(rpcUrl);
|
|
36
|
-
const aztecCheatCodes = new AztecCheatCodes(pxe, ethCheatCodes);
|
|
37
|
-
const rollupCheatCodes = new RollupCheatCodes(
|
|
38
|
-
ethCheatCodes,
|
|
39
|
-
await pxe.getNodeInfo().then(n => n.l1ContractAddresses),
|
|
40
|
-
);
|
|
41
|
-
return new CheatCodes(ethCheatCodes, aztecCheatCodes, rollupCheatCodes);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
static createRollup(rpcUrl: string, addresses: Pick<L1ContractAddresses, 'rollupAddress'>): RollupCheatCodes {
|
|
45
|
-
const ethCheatCodes = new EthCheatCodes(rpcUrl);
|
|
46
|
-
return new RollupCheatCodes(ethCheatCodes, addresses);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
20
|
+
export { EthCheatCodes };
|
|
49
21
|
|
|
50
22
|
/** Cheat codes for the L1 rollup contract. */
|
|
51
23
|
export class RollupCheatCodes {
|
|
@@ -96,8 +68,8 @@ export class RollupCheatCodes {
|
|
|
96
68
|
/** Slot duration */ slotDuration: bigint;
|
|
97
69
|
}> {
|
|
98
70
|
const [epochDuration, slotDuration] = await Promise.all([
|
|
99
|
-
this.rollup.read.
|
|
100
|
-
this.rollup.read.
|
|
71
|
+
this.rollup.read.getEpochDuration(),
|
|
72
|
+
this.rollup.read.getSlotDuration(),
|
|
101
73
|
]);
|
|
102
74
|
return { epochDuration, slotDuration };
|
|
103
75
|
}
|
|
@@ -128,7 +100,7 @@ export class RollupCheatCodes {
|
|
|
128
100
|
*/
|
|
129
101
|
public async advanceSlots(howMany: number) {
|
|
130
102
|
const l1Timestamp = (await this.client.getBlock()).timestamp;
|
|
131
|
-
const slotDuration = await this.rollup.read.
|
|
103
|
+
const slotDuration = await this.rollup.read.getSlotDuration();
|
|
132
104
|
const timeToWarp = BigInt(howMany) * slotDuration;
|
|
133
105
|
await this.ethCheatCodes.warp(l1Timestamp + timeToWarp, true);
|
|
134
106
|
const [slot, epoch] = await Promise.all([this.getSlot(), this.getEpoch()]);
|
|
@@ -198,78 +170,3 @@ export class RollupCheatCodes {
|
|
|
198
170
|
});
|
|
199
171
|
}
|
|
200
172
|
}
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* A class that provides utility functions for interacting with the aztec chain.
|
|
204
|
-
*/
|
|
205
|
-
export class AztecCheatCodes {
|
|
206
|
-
constructor(
|
|
207
|
-
/**
|
|
208
|
-
* The PXE Service to use for interacting with the chain
|
|
209
|
-
*/
|
|
210
|
-
public pxe: PXE,
|
|
211
|
-
/**
|
|
212
|
-
* The eth cheat codes.
|
|
213
|
-
*/
|
|
214
|
-
public eth: EthCheatCodes,
|
|
215
|
-
/**
|
|
216
|
-
* The logger to use for the aztec cheatcodes
|
|
217
|
-
*/
|
|
218
|
-
public logger = createLogger('aztecjs:cheat_codes'),
|
|
219
|
-
) {}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Computes the slot value for a given map and key.
|
|
223
|
-
* @param mapSlot - The slot of the map (specified in Aztec.nr contract)
|
|
224
|
-
* @param key - The key to lookup in the map
|
|
225
|
-
* @returns The storage slot of the value in the map
|
|
226
|
-
*/
|
|
227
|
-
public computeSlotInMap(mapSlot: Fr | bigint, key: Fr | bigint | AztecAddress): Promise<Fr> {
|
|
228
|
-
const keyFr = typeof key === 'bigint' ? new Fr(key) : key.toField();
|
|
229
|
-
return deriveStorageSlotInMap(mapSlot, keyFr);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* Get the current blocknumber
|
|
234
|
-
* @returns The current block number
|
|
235
|
-
*/
|
|
236
|
-
public async blockNumber(): Promise<number> {
|
|
237
|
-
return await this.pxe.getBlockNumber();
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* Get the current timestamp
|
|
242
|
-
* @returns The current timestamp
|
|
243
|
-
*/
|
|
244
|
-
public async timestamp(): Promise<number> {
|
|
245
|
-
const res = await this.pxe.getBlock(await this.blockNumber());
|
|
246
|
-
return res?.header.globalVariables.timestamp.toNumber() ?? 0;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Loads the value stored at the given slot in the public storage of the given contract.
|
|
251
|
-
* @param who - The address of the contract
|
|
252
|
-
* @param slot - The storage slot to lookup
|
|
253
|
-
* @returns The value stored at the given slot
|
|
254
|
-
*/
|
|
255
|
-
public async loadPublic(who: AztecAddress, slot: Fr | bigint): Promise<Fr> {
|
|
256
|
-
const storageValue = await this.pxe.getPublicStorageAt(who, new Fr(slot));
|
|
257
|
-
return storageValue;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* Loads the value stored at the given slot in the private storage of the given contract.
|
|
262
|
-
* @param contract - The address of the contract
|
|
263
|
-
* @param owner - The owner for whom the notes are encrypted
|
|
264
|
-
* @param slot - The storage slot to lookup
|
|
265
|
-
* @returns The notes stored at the given slot
|
|
266
|
-
*/
|
|
267
|
-
public async loadPrivate(owner: AztecAddress, contract: AztecAddress, slot: Fr | bigint): Promise<Note[]> {
|
|
268
|
-
const extendedNotes = await this.pxe.getNotes({
|
|
269
|
-
owner,
|
|
270
|
-
contractAddress: contract,
|
|
271
|
-
storageSlot: new Fr(slot),
|
|
272
|
-
});
|
|
273
|
-
return extendedNotes.map(extendedNote => extendedNote.note);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export {
|
|
2
|
+
L1FeeJuicePortalManager,
|
|
3
|
+
L1ToL2TokenPortalManager,
|
|
4
|
+
L1TokenManager,
|
|
5
|
+
L1TokenPortalManager,
|
|
6
|
+
type L2AmountClaim,
|
|
7
|
+
type L2AmountClaimWithRecipient,
|
|
8
|
+
type L2Claim,
|
|
9
|
+
generateClaimSecret,
|
|
10
|
+
} from './portal_manager.js';
|
|
11
|
+
export { getL1ContractAddresses } from './l1_contracts.js';
|
|
12
|
+
export { RollupCheatCodes, EthCheatCodes } from './cheat_codes.js';
|
|
13
|
+
export { ChainMonitor } from './chain_monitor.js';
|
|
14
|
+
export { AnvilTestWatcher } from './anvil_test_watcher.js';
|
|
15
|
+
export { deployL1Contract, deployL1Contracts, DeployL1Contracts } from '@aztec/ethereum/deploy-l1-contracts';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
2
2
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
3
3
|
|
|
4
|
-
import { createPXEClient } from '
|
|
4
|
+
import { createPXEClient } from '../../rpc_clients/index.js';
|
|
5
5
|
|
|
6
6
|
export const getL1ContractAddresses = async (url: string): Promise<L1ContractAddresses> => {
|
|
7
7
|
const pxeClient = createPXEClient(url);
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Fr,
|
|
5
|
-
type Logger,
|
|
6
|
-
type PXE,
|
|
7
|
-
type SiblingPath,
|
|
8
|
-
computeSecretHash,
|
|
9
|
-
} from '@aztec/aztec.js';
|
|
1
|
+
import { type PXE, type SiblingPath } from '@aztec/circuit-types';
|
|
2
|
+
import { type AztecAddress, EthAddress, Fr } from '@aztec/circuits.js';
|
|
3
|
+
import { computeSecretHash } from '@aztec/circuits.js/hash';
|
|
10
4
|
import { extractEvent } from '@aztec/ethereum/utils';
|
|
11
5
|
import { sha256ToField } from '@aztec/foundation/crypto';
|
|
6
|
+
import { type Logger } from '@aztec/foundation/log';
|
|
12
7
|
import { FeeJuicePortalAbi, OutboxAbi, TestERC20Abi, TokenPortalAbi } from '@aztec/l1-artifacts';
|
|
13
8
|
|
|
14
9
|
import {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { PXE } from '@aztec/circuit-types/interfaces';
|
|
1
|
+
export type { PXE } from '@aztec/circuit-types/interfaces';
|
package/src/api/log.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createLogger, type Logger } from '@aztec/foundation/log';
|
package/src/api/wallet.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import { type Wallet } from '../account/wallet.js';
|
|
12
12
|
import { BaseContractInteraction, type SendMethodOptions } from './base_contract_interaction.js';
|
|
13
13
|
|
|
14
|
-
export { SendMethodOptions };
|
|
14
|
+
export type { SendMethodOptions };
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Represents the options for simulating a contract function interaction.
|
package/src/contract/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The `contract` module provides utilities for deploying and interacting with contracts, based on a
|
|
3
3
|
* `Wallet` instance and a compiled artifact. Refer to the {@link account} module for how to obtain a valid
|
|
4
|
-
* `Wallet` instance, and to the {@link https://docs.aztec.network/developers/
|
|
4
|
+
* `Wallet` instance, and to the {@link https://docs.aztec.network/developers/guides/smart_contracts/how_to_compile_contract | Compiling contracts}
|
|
5
5
|
* section of the documentation for how to generate an artifact out of your Noir source code.
|
|
6
6
|
*
|
|
7
7
|
* The {@link Contract} class is the main class in this module, and provides static methods for deploying
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* has synchronized its changes.
|
|
31
31
|
*
|
|
32
32
|
* @remarks If you are using typescript, consider using the
|
|
33
|
-
* {@link https://docs.aztec.network/developers/
|
|
33
|
+
* {@link https://docs.aztec.network/developers/guides/smart_contracts/how_to_compile_contract#typescript-interfaces | autogenerated type-safe interfaces}
|
|
34
34
|
* for interacting with your contracts.
|
|
35
35
|
*
|
|
36
36
|
* @packageDocumentation
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { type EntrypointInterface, EntrypointPayload, type ExecutionRequestInit } from '@aztec/aztec.js/entrypoint';
|
|
2
1
|
import { HashedValues, TxExecutionRequest } from '@aztec/circuit-types';
|
|
3
2
|
import { type AztecAddress, TxContext } from '@aztec/circuits.js';
|
|
4
3
|
import { type FunctionAbi, FunctionSelector, encodeArguments } from '@aztec/foundation/abi';
|
|
5
4
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
6
5
|
|
|
6
|
+
import { type EntrypointInterface, EntrypointPayload, type ExecutionRequestInit } from './entrypoint.js';
|
|
7
|
+
|
|
7
8
|
/**
|
|
8
9
|
* Implementation for an entrypoint interface that can execute multiple function calls in a single transaction
|
|
9
10
|
*/
|
|
@@ -3,7 +3,7 @@ import { type Fr } from '@aztec/circuits.js';
|
|
|
3
3
|
|
|
4
4
|
import { EntrypointPayload, type FeeOptions, computeCombinedPayloadHash } from './payload.js';
|
|
5
5
|
|
|
6
|
-
export { EntrypointPayload, FeeOptions, computeCombinedPayloadHash };
|
|
6
|
+
export { EntrypointPayload, type FeeOptions, computeCombinedPayloadHash };
|
|
7
7
|
|
|
8
8
|
export { DefaultEntrypoint } from './default_entrypoint.js';
|
|
9
9
|
export { DefaultMultiCallEntrypoint } from './default_multi_call_entrypoint.js';
|
|
@@ -4,7 +4,7 @@ import { FunctionType, U128 } from '@aztec/foundation/abi';
|
|
|
4
4
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
5
5
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
6
6
|
|
|
7
|
-
import { type L2AmountClaim } from '../
|
|
7
|
+
import { type L2AmountClaim } from '../api/ethereum/portal_manager.js';
|
|
8
8
|
import { FeeJuicePaymentMethod } from './fee_juice_payment_method.js';
|
|
9
9
|
|
|
10
10
|
/**
|
package/src/index.ts
CHANGED
|
@@ -22,34 +22,6 @@
|
|
|
22
22
|
|
|
23
23
|
export { ContractDeployer } from './deployment/index.js';
|
|
24
24
|
|
|
25
|
-
export {
|
|
26
|
-
AnvilTestWatcher,
|
|
27
|
-
CheatCodes,
|
|
28
|
-
L1FeeJuicePortalManager,
|
|
29
|
-
L1ToL2TokenPortalManager,
|
|
30
|
-
L1TokenManager,
|
|
31
|
-
L1TokenPortalManager,
|
|
32
|
-
computeAuthWitMessageHash,
|
|
33
|
-
computeInnerAuthWitHash,
|
|
34
|
-
computeInnerAuthWitHashFromAction,
|
|
35
|
-
generateClaimSecret,
|
|
36
|
-
generatePublicKey,
|
|
37
|
-
readFieldCompressedString,
|
|
38
|
-
waitForPXE,
|
|
39
|
-
waitForNode,
|
|
40
|
-
type AztecAddressLike,
|
|
41
|
-
type EthAddressLike,
|
|
42
|
-
type EventSelectorLike,
|
|
43
|
-
type FieldLike,
|
|
44
|
-
type FunctionSelectorLike,
|
|
45
|
-
type L2AmountClaim,
|
|
46
|
-
type L2AmountClaimWithRecipient,
|
|
47
|
-
type L2Claim,
|
|
48
|
-
type U128Like,
|
|
49
|
-
type WrappedFieldLike,
|
|
50
|
-
type IntentAction,
|
|
51
|
-
} from './utils/index.js';
|
|
52
|
-
|
|
53
25
|
export { NoteSelector } from '@aztec/foundation/abi';
|
|
54
26
|
|
|
55
27
|
export { createCompatibleClient, createPXEClient } from './rpc_clients/index.js';
|
|
@@ -64,15 +36,15 @@ export { AccountWallet, AccountWalletWithSecretKey, SignerlessWallet, type Walle
|
|
|
64
36
|
// // TODO https://github.com/AztecProtocol/aztec-packages/issues/2632 --> FunctionSelector might not need to be exposed
|
|
65
37
|
// // here once the issue is resolved.
|
|
66
38
|
export {
|
|
67
|
-
ContractClassWithId,
|
|
68
|
-
ContractInstanceWithAddress,
|
|
39
|
+
type ContractClassWithId,
|
|
40
|
+
type ContractInstanceWithAddress,
|
|
69
41
|
EthAddress,
|
|
70
42
|
Fq,
|
|
71
43
|
Fr,
|
|
72
44
|
GlobalVariables,
|
|
73
45
|
GrumpkinScalar,
|
|
74
46
|
INITIAL_L2_BLOCK_NUM,
|
|
75
|
-
NodeInfo,
|
|
47
|
+
type NodeInfo,
|
|
76
48
|
Point,
|
|
77
49
|
PublicKeys,
|
|
78
50
|
getContractClassFromArtifact,
|
|
@@ -120,12 +92,10 @@ export {
|
|
|
120
92
|
TxStatus,
|
|
121
93
|
UnencryptedL2Log,
|
|
122
94
|
UniqueNote,
|
|
123
|
-
createAztecNodeClient,
|
|
124
95
|
getTimestampRangeForEpoch,
|
|
125
96
|
merkleTreeIds,
|
|
126
97
|
mockEpochProofQuote,
|
|
127
98
|
mockTx,
|
|
128
|
-
type AztecNode,
|
|
129
99
|
type LogFilter,
|
|
130
100
|
type PXE,
|
|
131
101
|
type PartialAddress,
|
|
@@ -139,7 +109,6 @@ export { decodeFromAbi, encodeArguments, type AbiType } from '@aztec/foundation/
|
|
|
139
109
|
export { toBigIntBE } from '@aztec/foundation/bigint-buffer';
|
|
140
110
|
export { sha256 } from '@aztec/foundation/crypto';
|
|
141
111
|
export { makeFetch } from '@aztec/foundation/json-rpc/client';
|
|
142
|
-
export { createLogger, type Logger } from '@aztec/foundation/log';
|
|
143
112
|
export { retry, retryUntil } from '@aztec/foundation/retry';
|
|
144
113
|
export { to2Fields, toBigInt } from '@aztec/foundation/serialize';
|
|
145
114
|
export { sleep } from '@aztec/foundation/sleep';
|
|
@@ -151,8 +120,11 @@ export { fileURLToPath } from '@aztec/foundation/url';
|
|
|
151
120
|
// Here you *can* do `export *` as the granular api defacto exports things explicitly.
|
|
152
121
|
// This entire index file will be deprecated at some point after we're satisfied.
|
|
153
122
|
export * from './api/abi.js';
|
|
123
|
+
export * from './api/cheat_codes.js';
|
|
154
124
|
export * from './api/fee.js';
|
|
155
125
|
export * from './api/addresses.js';
|
|
156
|
-
export * from './api/ethereum.js';
|
|
126
|
+
export * from './api/ethereum/index.js';
|
|
127
|
+
export * from './api/log.js';
|
|
157
128
|
// Granular export, even if not in the api folder
|
|
158
129
|
export * from './contract/index.js';
|
|
130
|
+
export * from './utils/index.js';
|