@aztec/aztec.js 3.0.0-nightly.20251118 → 3.0.0-nightly.20251120
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/api/contract.d.ts +1 -1
- package/dest/api/contract.js +1 -1
- package/dest/api/tx.d.ts +1 -1
- package/dest/api/tx.d.ts.map +1 -1
- package/dest/api/tx.js +1 -1
- package/dest/api/wallet.d.ts +1 -1
- package/dest/api/wallet.d.ts.map +1 -1
- package/dest/api/wallet.js +1 -1
- package/dest/contract/batch_call.js +1 -2
- package/dest/contract/contract.d.ts +1 -1
- package/dest/contract/contract.d.ts.map +1 -1
- package/dest/contract/contract.js +4 -5
- package/dest/contract/contract_base.d.ts +5 -9
- package/dest/contract/contract_base.d.ts.map +1 -1
- package/dest/contract/contract_base.js +5 -12
- package/dest/contract/deploy_method.d.ts +5 -4
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +4 -2
- package/dest/contract/deploy_sent_tx.d.ts +11 -6
- package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
- package/dest/contract/deploy_sent_tx.js +10 -4
- package/dest/contract/unsafe_contract.js +1 -1
- package/dest/deployment/contract_deployer.d.ts.map +1 -1
- package/dest/deployment/contract_deployer.js +1 -1
- package/dest/wallet/account_manager.js +1 -1
- package/dest/wallet/base_wallet.d.ts +4 -4
- package/dest/wallet/base_wallet.d.ts.map +1 -1
- package/dest/wallet/base_wallet.js +24 -41
- package/dest/wallet/deploy_account_method.d.ts +2 -2
- package/dest/wallet/deploy_account_method.d.ts.map +1 -1
- package/dest/wallet/wallet.d.ts +57 -860
- package/dest/wallet/wallet.d.ts.map +1 -1
- package/dest/wallet/wallet.js +7 -28
- package/package.json +8 -8
- package/src/api/contract.ts +1 -1
- package/src/api/tx.ts +1 -0
- package/src/api/wallet.ts +0 -3
- package/src/contract/batch_call.ts +1 -1
- package/src/contract/contract.ts +7 -5
- package/src/contract/contract_base.ts +5 -15
- package/src/contract/deploy_method.ts +8 -7
- package/src/contract/deploy_sent_tx.ts +17 -10
- package/src/contract/unsafe_contract.ts +1 -1
- package/src/deployment/contract_deployer.ts +3 -2
- package/src/wallet/account_manager.ts +1 -1
- package/src/wallet/base_wallet.ts +26 -49
- package/src/wallet/deploy_account_method.ts +2 -1
- package/src/wallet/wallet.ts +9 -45
package/src/wallet/wallet.ts
CHANGED
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
type ContractArtifact,
|
|
6
6
|
ContractArtifactSchema,
|
|
7
7
|
type EventMetadataDefinition,
|
|
8
|
-
FunctionAbiSchema,
|
|
9
8
|
type FunctionCall,
|
|
10
9
|
FunctionType,
|
|
11
10
|
} from '@aztec/stdlib/abi';
|
|
@@ -16,11 +15,9 @@ import {
|
|
|
16
15
|
ContractClassWithIdSchema,
|
|
17
16
|
type ContractInstanceWithAddress,
|
|
18
17
|
ContractInstanceWithAddressSchema,
|
|
19
|
-
type ContractInstantiationData,
|
|
20
18
|
type ContractMetadata,
|
|
21
19
|
} from '@aztec/stdlib/contract';
|
|
22
20
|
import { Gas } from '@aztec/stdlib/gas';
|
|
23
|
-
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
24
21
|
import { AbiDecodedSchema, type ApiSchemaFor, type ZodFor, optional, schemas } from '@aztec/stdlib/schemas';
|
|
25
22
|
import {
|
|
26
23
|
Capsule,
|
|
@@ -35,7 +32,6 @@ import type { ExecutionPayload } from '@aztec/stdlib/tx';
|
|
|
35
32
|
|
|
36
33
|
import { z } from 'zod';
|
|
37
34
|
|
|
38
|
-
import type { Contract } from '../contract/contract.js';
|
|
39
35
|
import type {
|
|
40
36
|
FeeEstimationOptions,
|
|
41
37
|
GasSettingsOption,
|
|
@@ -59,11 +55,6 @@ export type Aliased<T> = {
|
|
|
59
55
|
item: T;
|
|
60
56
|
};
|
|
61
57
|
|
|
62
|
-
/**
|
|
63
|
-
* A reduced representation of a Contract, only including its instance and artifact
|
|
64
|
-
*/
|
|
65
|
-
export type ContractInstanceAndArtifact = Pick<Contract, 'artifact' | 'instance'>;
|
|
66
|
-
|
|
67
58
|
/**
|
|
68
59
|
* Options for simulating interactions with the wallet. Overrides the fee settings of an interaction with
|
|
69
60
|
* a simplified version that only hints at the wallet wether the interaction contains a
|
|
@@ -157,39 +148,18 @@ export type Wallet = {
|
|
|
157
148
|
getAddressBook(): Promise<Aliased<AztecAddress>[]>;
|
|
158
149
|
getAccounts(): Promise<Aliased<AztecAddress>[]>;
|
|
159
150
|
registerContract(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
registerContract(
|
|
164
|
-
instanceData: AztecAddress | ContractInstanceWithAddress | ContractInstantiationData | ContractInstanceAndArtifact,
|
|
165
|
-
artifact: ContractArtifact,
|
|
166
|
-
): Promise<ContractInstanceWithAddress>;
|
|
167
|
-
registerContract(
|
|
168
|
-
instanceData: AztecAddress | ContractInstanceWithAddress | ContractInstantiationData | ContractInstanceAndArtifact,
|
|
169
|
-
artifact: ContractArtifact | undefined,
|
|
170
|
-
secretKey: Fr | undefined,
|
|
151
|
+
instance: ContractInstanceWithAddress,
|
|
152
|
+
artifact?: ContractArtifact,
|
|
153
|
+
secretKey?: Fr,
|
|
171
154
|
): Promise<ContractInstanceWithAddress>;
|
|
172
155
|
simulateTx(exec: ExecutionPayload, opts: SimulateOptions): Promise<TxSimulationResult>;
|
|
173
|
-
simulateUtility(
|
|
174
|
-
call: FunctionCall,
|
|
175
|
-
authwits?: AuthWitness[],
|
|
176
|
-
scopes?: AztecAddress[],
|
|
177
|
-
): Promise<UtilitySimulationResult>;
|
|
156
|
+
simulateUtility(call: FunctionCall, authwits?: AuthWitness[]): Promise<UtilitySimulationResult>;
|
|
178
157
|
profileTx(exec: ExecutionPayload, opts: ProfileOptions): Promise<TxProfileResult>;
|
|
179
158
|
sendTx(exec: ExecutionPayload, opts: SendOptions): Promise<TxHash>;
|
|
180
159
|
createAuthWit(from: AztecAddress, messageHashOrIntent: Fr | IntentInnerHash | CallIntent): Promise<AuthWitness>;
|
|
181
160
|
batch<const T extends readonly BatchedMethod<keyof BatchableMethods>[]>(methods: T): Promise<BatchResults<T>>;
|
|
182
161
|
};
|
|
183
162
|
|
|
184
|
-
export const ContractInstantiationDataSchema = z.object({
|
|
185
|
-
constructorArtifact: optional(z.union([FunctionAbiSchema, z.string()])),
|
|
186
|
-
constructorArgs: optional(z.array(z.any())),
|
|
187
|
-
skipArgsDecoding: optional(z.boolean()),
|
|
188
|
-
salt: schemas.Fr,
|
|
189
|
-
publicKeys: optional(PublicKeys.schema),
|
|
190
|
-
deployer: optional(schemas.AztecAddress),
|
|
191
|
-
});
|
|
192
|
-
|
|
193
163
|
export const FunctionCallSchema = z.object({
|
|
194
164
|
name: z.string(),
|
|
195
165
|
to: schemas.AztecAddress,
|
|
@@ -206,6 +176,7 @@ export const ExecutionPayloadSchema = z.object({
|
|
|
206
176
|
authWitnesses: z.array(AuthWitness.schema),
|
|
207
177
|
capsules: z.array(Capsule.schema),
|
|
208
178
|
extraHashedArgs: z.array(HashedValues.schema),
|
|
179
|
+
feePayer: optional(schemas.AztecAddress),
|
|
209
180
|
});
|
|
210
181
|
|
|
211
182
|
export const GasSettingsOptionSchema = z.object({
|
|
@@ -246,13 +217,6 @@ export const ProfileOptionsSchema = SimulateOptionsSchema.extend({
|
|
|
246
217
|
skipProofGeneration: optional(z.boolean()),
|
|
247
218
|
});
|
|
248
219
|
|
|
249
|
-
export const InstanceDataSchema = z.union([
|
|
250
|
-
schemas.AztecAddress,
|
|
251
|
-
ContractInstanceWithAddressSchema,
|
|
252
|
-
ContractInstantiationDataSchema,
|
|
253
|
-
z.object({ instance: ContractInstanceWithAddressSchema, artifact: ContractArtifactSchema }),
|
|
254
|
-
]);
|
|
255
|
-
|
|
256
220
|
export const MessageHashOrIntentSchema = z.union([
|
|
257
221
|
schemas.Fr,
|
|
258
222
|
z.object({ consumer: schemas.AztecAddress, innerHash: schemas.Fr }),
|
|
@@ -269,7 +233,7 @@ export const BatchedMethodSchema = z.union([
|
|
|
269
233
|
}),
|
|
270
234
|
z.object({
|
|
271
235
|
name: z.literal('registerContract'),
|
|
272
|
-
args: z.tuple([
|
|
236
|
+
args: z.tuple([ContractInstanceWithAddressSchema, optional(ContractArtifactSchema), optional(schemas.Fr)]),
|
|
273
237
|
}),
|
|
274
238
|
z.object({
|
|
275
239
|
name: z.literal('sendTx'),
|
|
@@ -277,7 +241,7 @@ export const BatchedMethodSchema = z.union([
|
|
|
277
241
|
}),
|
|
278
242
|
z.object({
|
|
279
243
|
name: z.literal('simulateUtility'),
|
|
280
|
-
args: z.tuple([FunctionCallSchema, optional(z.array(AuthWitness.schema))
|
|
244
|
+
args: z.tuple([FunctionCallSchema, optional(z.array(AuthWitness.schema))]),
|
|
281
245
|
}),
|
|
282
246
|
z.object({
|
|
283
247
|
name: z.literal('simulateTx'),
|
|
@@ -326,12 +290,12 @@ export const WalletSchema: ApiSchemaFor<Wallet> = {
|
|
|
326
290
|
.returns(z.array(z.object({ alias: z.string(), item: schemas.AztecAddress }))),
|
|
327
291
|
registerContract: z
|
|
328
292
|
.function()
|
|
329
|
-
.args(
|
|
293
|
+
.args(ContractInstanceWithAddressSchema, optional(ContractArtifactSchema), optional(schemas.Fr))
|
|
330
294
|
.returns(ContractInstanceWithAddressSchema),
|
|
331
295
|
simulateTx: z.function().args(ExecutionPayloadSchema, SimulateOptionsSchema).returns(TxSimulationResult.schema),
|
|
332
296
|
simulateUtility: z
|
|
333
297
|
.function()
|
|
334
|
-
.args(FunctionCallSchema, optional(z.array(AuthWitness.schema))
|
|
298
|
+
.args(FunctionCallSchema, optional(z.array(AuthWitness.schema)))
|
|
335
299
|
.returns(UtilitySimulationResult.schema),
|
|
336
300
|
profileTx: z.function().args(ExecutionPayloadSchema, ProfileOptionsSchema).returns(TxProfileResult.schema),
|
|
337
301
|
sendTx: z.function().args(ExecutionPayloadSchema, SendOptionsSchema).returns(TxHash.schema),
|