@aztec/aztec.js 3.0.0-nightly.20251208 → 3.0.0-nightly.20251210
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/account.d.ts +2 -2
- package/dest/account/account.d.ts.map +1 -1
- package/dest/account/account.js +1 -1
- package/dest/account/account_contract.d.ts +2 -2
- package/dest/account/account_contract.d.ts.map +1 -1
- package/dest/account/account_with_secret_key.d.ts +3 -3
- package/dest/account/account_with_secret_key.d.ts.map +1 -1
- package/dest/account/index.d.ts +2 -2
- package/dest/account/index.d.ts.map +1 -1
- package/dest/account/interface.d.ts +2 -2
- package/dest/account/interface.d.ts.map +1 -1
- package/dest/account/signerless_account.d.ts +2 -2
- package/dest/account/signerless_account.d.ts.map +1 -1
- package/dest/api/fields.d.ts +3 -2
- package/dest/api/fields.d.ts.map +1 -1
- package/dest/api/fields.js +2 -1
- package/dest/api/wallet.d.ts +2 -2
- package/dest/api/wallet.d.ts.map +1 -1
- package/dest/api/wallet.js +1 -1
- package/dest/authorization/call_authorization_request.d.ts +2 -2
- package/dest/authorization/call_authorization_request.d.ts.map +1 -1
- package/dest/contract/deploy_method.d.ts +2 -2
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +1 -1
- package/dest/deployment/broadcast_function.js +1 -1
- package/dest/deployment/publish_class.js +1 -1
- package/dest/ethereum/portal_manager.d.ts +2 -2
- package/dest/ethereum/portal_manager.d.ts.map +1 -1
- package/dest/ethereum/portal_manager.js +2 -2
- package/dest/fee/fee_juice_payment_method_with_claim.js +1 -1
- package/dest/fee/private_fee_payment_method.js +1 -1
- package/dest/fee/public_fee_payment_method.js +1 -1
- package/dest/utils/abi_types.d.ts +2 -2
- package/dest/utils/abi_types.d.ts.map +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/cross_chain.d.ts +2 -2
- package/dest/utils/cross_chain.d.ts.map +1 -1
- package/dest/utils/fee_juice.js +1 -1
- package/dest/utils/field_compressed_string.js +1 -1
- package/dest/utils/pub_key.d.ts +2 -2
- package/dest/utils/pub_key.d.ts.map +1 -1
- package/dest/utils/pub_key.js +1 -1
- package/dest/wallet/account_manager.d.ts +2 -2
- package/dest/wallet/account_manager.d.ts.map +1 -1
- package/dest/wallet/account_manager.js +1 -1
- package/dest/wallet/deploy_account_method.d.ts +2 -2
- package/dest/wallet/deploy_account_method.d.ts.map +1 -1
- package/dest/wallet/deploy_account_method.js +1 -1
- package/dest/wallet/wallet.d.ts +72 -21
- package/dest/wallet/wallet.d.ts.map +1 -1
- package/dest/wallet/wallet.js +14 -2
- package/package.json +8 -8
- package/src/account/account.ts +1 -1
- package/src/account/account_contract.ts +1 -1
- package/src/account/account_with_secret_key.ts +1 -1
- package/src/account/index.ts +1 -1
- package/src/account/interface.ts +1 -1
- package/src/account/signerless_account.ts +1 -1
- package/src/api/fields.ts +2 -1
- package/src/api/wallet.ts +4 -0
- package/src/authorization/call_authorization_request.ts +1 -1
- package/src/contract/deploy_method.ts +1 -1
- package/src/deployment/broadcast_function.ts +1 -1
- package/src/deployment/publish_class.ts +1 -1
- package/src/ethereum/portal_manager.ts +2 -2
- package/src/fee/fee_juice_payment_method_with_claim.ts +1 -1
- package/src/fee/private_fee_payment_method.ts +1 -1
- package/src/fee/public_fee_payment_method.ts +1 -1
- package/src/utils/abi_types.ts +1 -1
- package/src/utils/authwit.ts +1 -1
- package/src/utils/cross_chain.ts +1 -1
- package/src/utils/fee_juice.ts +1 -1
- package/src/utils/field_compressed_string.ts +1 -1
- package/src/utils/pub_key.ts +2 -2
- package/src/wallet/account_manager.ts +1 -1
- package/src/wallet/deploy_account_method.ts +1 -1
- package/src/wallet/wallet.ts +54 -9
package/src/wallet/wallet.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ChainInfo } from '@aztec/entrypoints/interfaces';
|
|
2
|
-
import
|
|
2
|
+
import { BlockNumber, BlockNumberPositiveSchema } from '@aztec/foundation/branded-types';
|
|
3
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
4
|
import {
|
|
5
|
+
type AbiDecoded,
|
|
4
6
|
AbiTypeSchema,
|
|
5
7
|
type ContractArtifact,
|
|
6
8
|
ContractArtifactSchema,
|
|
@@ -27,8 +29,9 @@ import {
|
|
|
27
29
|
TxReceipt,
|
|
28
30
|
TxSimulationResult,
|
|
29
31
|
UtilitySimulationResult,
|
|
32
|
+
inTxSchema,
|
|
30
33
|
} from '@aztec/stdlib/tx';
|
|
31
|
-
import type { ExecutionPayload } from '@aztec/stdlib/tx';
|
|
34
|
+
import type { ExecutionPayload, InTx } from '@aztec/stdlib/tx';
|
|
32
35
|
|
|
33
36
|
import { z } from 'zod';
|
|
34
37
|
|
|
@@ -129,6 +132,38 @@ export type BatchResults<T extends readonly BatchedMethod<keyof BatchableMethods
|
|
|
129
132
|
[K in keyof T]: BatchedMethodResultWrapper<T[K]>;
|
|
130
133
|
};
|
|
131
134
|
|
|
135
|
+
/**
|
|
136
|
+
* Filter options when querying private events.
|
|
137
|
+
*/
|
|
138
|
+
export type PrivateEventFilter = {
|
|
139
|
+
/** The address of the contract that emitted the events. */
|
|
140
|
+
contractAddress: AztecAddress;
|
|
141
|
+
/** Addresses of accounts that are in scope for this filter. */
|
|
142
|
+
scopes: AztecAddress[];
|
|
143
|
+
/** Transaction in which the events were emitted. */
|
|
144
|
+
txHash?: TxHash;
|
|
145
|
+
/** The block number from which to start fetching events (inclusive).
|
|
146
|
+
* Optional. If provided, it must be greater or equal than 1.
|
|
147
|
+
* Defaults to the initial L2 block number (INITIAL_L2_BLOCK_NUM).
|
|
148
|
+
* */
|
|
149
|
+
fromBlock?: BlockNumber;
|
|
150
|
+
/** The block number until which to fetch logs (not inclusive).
|
|
151
|
+
* Optional. If provided, it must be greater than fromBlock.
|
|
152
|
+
* Defaults to the latest known block to PXE + 1.
|
|
153
|
+
*/
|
|
154
|
+
toBlock?: BlockNumber;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* An ABI decoded private event with associated metadata.
|
|
159
|
+
*/
|
|
160
|
+
export type PrivateEvent<T> = {
|
|
161
|
+
/** The ABI decoded event */
|
|
162
|
+
event: T;
|
|
163
|
+
/** Metadata describing event context information such as tx and block */
|
|
164
|
+
metadata: InTx;
|
|
165
|
+
};
|
|
166
|
+
|
|
132
167
|
/**
|
|
133
168
|
* The wallet interface.
|
|
134
169
|
*/
|
|
@@ -136,12 +171,9 @@ export type Wallet = {
|
|
|
136
171
|
getContractClassMetadata(id: Fr, includeArtifact?: boolean): Promise<ContractClassMetadata>;
|
|
137
172
|
getContractMetadata(address: AztecAddress): Promise<ContractMetadata>;
|
|
138
173
|
getPrivateEvents<T>(
|
|
139
|
-
contractAddress: AztecAddress,
|
|
140
174
|
eventMetadata: EventMetadataDefinition,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
recipients: AztecAddress[],
|
|
144
|
-
): Promise<T[]>;
|
|
175
|
+
eventFilter: PrivateEventFilter,
|
|
176
|
+
): Promise<PrivateEvent<T>[]>;
|
|
145
177
|
getChainInfo(): Promise<ChainInfo>;
|
|
146
178
|
getTxReceipt(txHash: TxHash): Promise<TxReceipt>;
|
|
147
179
|
registerSender(address: AztecAddress, alias?: string): Promise<AztecAddress>;
|
|
@@ -267,6 +299,19 @@ export const EventMetadataDefinitionSchema = z.object({
|
|
|
267
299
|
fieldNames: z.array(z.string()),
|
|
268
300
|
});
|
|
269
301
|
|
|
302
|
+
export const PrivateEventSchema: ZodFor<PrivateEvent<AbiDecoded>> = z.object({
|
|
303
|
+
event: AbiDecodedSchema,
|
|
304
|
+
metadata: inTxSchema(),
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
export const PrivateEventFilterSchema = z.object({
|
|
308
|
+
contractAddress: schemas.AztecAddress,
|
|
309
|
+
scopes: z.array(schemas.AztecAddress),
|
|
310
|
+
txHash: optional(TxHash.schema),
|
|
311
|
+
fromBlock: optional(BlockNumberPositiveSchema),
|
|
312
|
+
toBlock: optional(BlockNumberPositiveSchema),
|
|
313
|
+
});
|
|
314
|
+
|
|
270
315
|
export const WalletSchema: ApiSchemaFor<Wallet> = {
|
|
271
316
|
getChainInfo: z
|
|
272
317
|
.function()
|
|
@@ -277,8 +322,8 @@ export const WalletSchema: ApiSchemaFor<Wallet> = {
|
|
|
277
322
|
getTxReceipt: z.function().args(TxHash.schema).returns(TxReceipt.schema),
|
|
278
323
|
getPrivateEvents: z
|
|
279
324
|
.function()
|
|
280
|
-
.args(
|
|
281
|
-
.returns(z.array(
|
|
325
|
+
.args(EventMetadataDefinitionSchema, PrivateEventFilterSchema)
|
|
326
|
+
.returns(z.array(PrivateEventSchema)),
|
|
282
327
|
registerSender: z.function().args(schemas.AztecAddress, optional(z.string())).returns(schemas.AztecAddress),
|
|
283
328
|
getAddressBook: z
|
|
284
329
|
.function()
|