@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.
- package/README.md +2 -2
- package/dest/account/contract.d.ts +4 -4
- package/dest/account/contract.d.ts.map +1 -1
- package/dest/account/index.d.ts +1 -1
- package/dest/account/index.d.ts.map +1 -1
- package/dest/account/interface.d.ts +5 -5
- package/dest/account/interface.d.ts.map +1 -1
- package/dest/account/wallet.d.ts +2 -2
- package/dest/account/wallet.d.ts.map +1 -1
- package/dest/account_manager/deploy_account_sent_tx.d.ts +4 -4
- package/dest/account_manager/deploy_account_sent_tx.d.ts.map +1 -1
- package/dest/account_manager/deploy_account_sent_tx.js +1 -1
- package/dest/account_manager/index.d.ts +7 -7
- package/dest/account_manager/index.d.ts.map +1 -1
- package/dest/account_manager/index.js +1 -1
- package/dest/contract/base_contract_interaction.d.ts +4 -4
- package/dest/contract/base_contract_interaction.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.js +5 -5
- package/dest/contract/batch_call.d.ts +3 -3
- package/dest/contract/batch_call.d.ts.map +1 -1
- package/dest/contract/batch_call.js +1 -1
- package/dest/contract/checker.d.ts +1 -1
- package/dest/contract/checker.d.ts.map +1 -1
- package/dest/contract/checker.js +2 -2
- package/dest/contract/contract.d.ts +4 -4
- package/dest/contract/contract.d.ts.map +1 -1
- package/dest/contract/contract_base.d.ts +44 -4
- package/dest/contract/contract_base.d.ts.map +1 -1
- package/dest/contract/contract_base.js +1 -1
- package/dest/contract/contract_function_interaction.d.ts +21 -12
- package/dest/contract/contract_function_interaction.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.js +41 -11
- package/dest/contract/deploy_method.d.ts +11 -11
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +8 -6
- package/dest/contract/deploy_sent_tx.d.ts +8 -7
- package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
- package/dest/contract/deploy_sent_tx.js +4 -1
- package/dest/contract/index.d.ts +3 -3
- package/dest/contract/index.js +3 -3
- package/dest/contract/sent_tx.d.ts +2 -2
- package/dest/contract/sent_tx.d.ts.map +1 -1
- package/dest/contract/sent_tx.js +6 -6
- package/dest/contract/unsafe_contract.d.ts +3 -3
- package/dest/contract/unsafe_contract.d.ts.map +1 -1
- package/dest/deployment/broadcast_function.d.ts +3 -3
- package/dest/deployment/broadcast_function.d.ts.map +1 -1
- package/dest/deployment/broadcast_function.js +1 -1
- package/dest/deployment/contract_deployer.d.ts +2 -2
- package/dest/deployment/contract_deployer.d.ts.map +1 -1
- package/dest/deployment/deploy_instance.d.ts +3 -3
- package/dest/deployment/deploy_instance.d.ts.map +1 -1
- package/dest/deployment/protocol_contracts.d.ts +1 -1
- package/dest/deployment/protocol_contracts.d.ts.map +1 -1
- package/dest/deployment/register_class.d.ts +3 -3
- package/dest/deployment/register_class.d.ts.map +1 -1
- package/dest/deployment/register_class.js +1 -1
- package/dest/entrypoint/default_entrypoint.d.ts +2 -2
- package/dest/entrypoint/default_entrypoint.d.ts.map +1 -1
- package/dest/entrypoint/default_entrypoint.js +1 -1
- package/dest/entrypoint/entrypoint.d.ts +3 -3
- package/dest/entrypoint/entrypoint.d.ts.map +1 -1
- package/dest/fee/fee_payment_method.d.ts +3 -3
- package/dest/fee/fee_payment_method.d.ts.map +1 -1
- package/dest/fee/native_fee_payment_method.d.ts +5 -5
- package/dest/fee/native_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/native_fee_payment_method.js +1 -1
- package/dest/fee/private_fee_payment_method.d.ts +4 -4
- package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/public_fee_payment_method.d.ts +4 -4
- package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
- package/dest/index.d.ts +1 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -1
- package/dest/rpc_clients/pxe_client.d.ts +1 -1
- package/dest/rpc_clients/pxe_client.d.ts.map +1 -1
- package/dest/rpc_clients/pxe_client.js +3 -3
- package/dest/utils/abi_types.d.ts +1 -1
- package/dest/utils/abi_types.d.ts.map +1 -1
- package/dest/utils/account.d.ts +2 -2
- package/dest/utils/account.d.ts.map +1 -1
- package/dest/utils/account.js +1 -1
- package/dest/utils/authwit.d.ts +2 -2
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +1 -1
- package/dest/utils/cheat_codes.d.ts +2 -2
- package/dest/utils/cheat_codes.d.ts.map +1 -1
- package/dest/utils/cheat_codes.js +1 -1
- package/dest/utils/l1_contracts.d.ts +1 -1
- package/dest/utils/l1_contracts.d.ts.map +1 -1
- package/dest/utils/pub_key.d.ts +1 -1
- package/dest/utils/pub_key.d.ts.map +1 -1
- package/dest/utils/pxe.d.ts +2 -2
- package/dest/utils/pxe.d.ts.map +1 -1
- package/dest/wallet/account_wallet.d.ts +4 -4
- package/dest/wallet/account_wallet.d.ts.map +1 -1
- package/dest/wallet/account_wallet.js +2 -2
- package/dest/wallet/account_wallet_with_private_key.d.ts +4 -4
- package/dest/wallet/account_wallet_with_private_key.d.ts.map +1 -1
- package/dest/wallet/base_wallet.d.ts +10 -9
- package/dest/wallet/base_wallet.d.ts.map +1 -1
- package/dest/wallet/base_wallet.js +6 -3
- package/dest/wallet/create_recipient.d.ts +1 -1
- package/dest/wallet/create_recipient.d.ts.map +1 -1
- package/dest/wallet/index.d.ts +3 -3
- package/dest/wallet/index.d.ts.map +1 -1
- package/dest/wallet/signerless_wallet.d.ts +3 -3
- package/dest/wallet/signerless_wallet.d.ts.map +1 -1
- package/package.json +17 -11
- package/src/account/contract.ts +4 -4
- package/src/account/index.ts +1 -1
- package/src/account/interface.ts +5 -5
- package/src/account/wallet.ts +2 -2
- package/src/account_manager/deploy_account_sent_tx.ts +4 -4
- package/src/account_manager/index.ts +8 -8
- package/src/contract/base_contract_interaction.ts +6 -6
- package/src/contract/batch_call.ts +3 -3
- package/src/contract/checker.ts +4 -4
- package/src/contract/contract.ts +4 -4
- package/src/contract/contract_base.ts +46 -4
- package/src/contract/contract_function_interaction.ts +47 -16
- package/src/contract/deploy_method.ts +17 -13
- package/src/contract/deploy_sent_tx.ts +11 -7
- package/src/contract/index.ts +3 -3
- package/src/contract/sent_tx.ts +13 -6
- package/src/contract/unsafe_contract.ts +3 -3
- package/src/deployment/broadcast_function.ts +3 -3
- package/src/deployment/contract_deployer.ts +4 -4
- package/src/deployment/deploy_instance.ts +3 -3
- package/src/deployment/protocol_contracts.ts +1 -1
- package/src/deployment/register_class.ts +3 -3
- package/src/entrypoint/default_entrypoint.ts +2 -2
- package/src/entrypoint/entrypoint.ts +3 -3
- package/src/fee/fee_payment_method.ts +3 -3
- package/src/fee/native_fee_payment_method.ts +5 -5
- package/src/fee/private_fee_payment_method.ts +4 -4
- package/src/fee/public_fee_payment_method.ts +4 -4
- package/src/index.ts +2 -0
- package/src/rpc_clients/pxe_client.ts +3 -2
- package/src/utils/abi_types.ts +1 -1
- package/src/utils/account.ts +2 -2
- package/src/utils/authwit.ts +2 -2
- package/src/utils/cheat_codes.ts +2 -2
- package/src/utils/l1_contracts.ts +1 -1
- package/src/utils/pub_key.ts +1 -1
- package/src/utils/pxe.ts +2 -2
- package/src/wallet/account_wallet.ts +6 -6
- package/src/wallet/account_wallet_with_private_key.ts +4 -4
- package/src/wallet/base_wallet.ts +33 -23
- package/src/wallet/create_recipient.ts +1 -1
- package/src/wallet/index.ts +3 -3
- package/src/wallet/signerless_wallet.ts +3 -3
package/src/utils/pub_key.ts
CHANGED
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.
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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 {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
99
|
-
return this.pxe.
|
|
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);
|
package/src/wallet/index.ts
CHANGED
|
@@ -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
|
/**
|