@aztec/aztec.js 3.0.0-devnet.2 → 3.0.0-devnet.2-patch.1
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/account.d.ts +3 -4
- 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 -4
- 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 +3 -4
- package/dest/account/signerless_account.d.ts.map +1 -1
- package/dest/api/abi.d.ts +1 -1
- package/dest/api/account.d.ts +2 -1
- package/dest/api/account.d.ts.map +1 -1
- package/dest/api/account.js +1 -0
- package/dest/api/addresses.d.ts +1 -1
- package/dest/api/authorization.d.ts +1 -1
- package/dest/api/block.d.ts +1 -1
- package/dest/api/contract.d.ts +5 -5
- package/dest/api/contract.d.ts.map +1 -1
- package/dest/api/contract.js +3 -3
- package/dest/api/crypto.d.ts +1 -1
- package/dest/api/deployment.d.ts +1 -1
- package/dest/api/eth_address.d.ts +1 -1
- package/dest/api/ethereum.d.ts +1 -1
- package/dest/api/events.d.ts +1 -1
- package/dest/api/fee.d.ts +1 -1
- package/dest/api/fee_testing.d.ts +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/keys.d.ts +1 -1
- package/dest/api/log.d.ts +1 -1
- package/dest/api/messaging.d.ts +1 -1
- package/dest/api/node.d.ts +1 -1
- package/dest/api/note.d.ts +2 -2
- package/dest/api/note.d.ts.map +1 -1
- package/dest/api/note.js +1 -1
- package/dest/api/protocol.d.ts +1 -1
- package/dest/api/trees.d.ts +1 -1
- package/dest/api/tx.d.ts +2 -2
- package/dest/api/tx.d.ts.map +1 -1
- package/dest/api/tx.js +1 -1
- package/dest/api/utils.d.ts +1 -1
- package/dest/api/wallet.d.ts +2 -3
- package/dest/api/wallet.d.ts.map +1 -1
- package/dest/api/wallet.js +1 -2
- package/dest/authorization/call_authorization_request.d.ts +2 -23
- package/dest/authorization/call_authorization_request.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.d.ts +2 -3
- package/dest/contract/base_contract_interaction.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.js +1 -1
- package/dest/contract/batch_call.d.ts +8 -9
- package/dest/contract/batch_call.d.ts.map +1 -1
- package/dest/contract/batch_call.js +51 -33
- package/dest/contract/checker.d.ts +1 -1
- package/dest/contract/contract.d.ts +2 -2
- package/dest/contract/contract.d.ts.map +1 -1
- package/dest/contract/contract.js +4 -5
- package/dest/contract/contract_base.d.ts +5 -12
- package/dest/contract/contract_base.d.ts.map +1 -1
- package/dest/contract/contract_base.js +5 -12
- package/dest/contract/contract_function_interaction.d.ts +4 -4
- package/dest/contract/contract_function_interaction.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.js +9 -6
- package/dest/contract/deploy_method.d.ts +9 -8
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +9 -7
- package/dest/contract/deploy_sent_tx.d.ts +12 -7
- package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
- package/dest/contract/deploy_sent_tx.js +10 -4
- package/dest/contract/get_gas_limits.d.ts +1 -1
- package/dest/contract/interaction_options.d.ts +5 -5
- package/dest/contract/interaction_options.d.ts.map +1 -1
- package/dest/contract/interaction_options.js +4 -10
- package/dest/contract/protocol_contracts.d.ts +1 -1
- package/dest/contract/sent_tx.d.ts +2 -3
- package/dest/contract/sent_tx.d.ts.map +1 -1
- package/dest/contract/sent_tx.js +1 -1
- package/dest/contract/unsafe_contract.d.ts +1 -1
- package/dest/contract/unsafe_contract.d.ts.map +1 -1
- package/dest/contract/unsafe_contract.js +1 -1
- package/dest/contract/wait_for_proven.d.ts +2 -2
- package/dest/contract/wait_for_proven.d.ts.map +1 -1
- package/dest/deployment/broadcast_function.d.ts +1 -1
- package/dest/deployment/broadcast_function.js +1 -1
- package/dest/deployment/contract_deployer.d.ts +1 -1
- package/dest/deployment/contract_deployer.d.ts.map +1 -1
- package/dest/deployment/contract_deployer.js +1 -1
- package/dest/deployment/publish_class.d.ts +1 -1
- package/dest/deployment/publish_class.js +1 -1
- package/dest/deployment/publish_instance.d.ts +1 -1
- package/dest/ethereum/portal_manager.d.ts +4 -6
- package/dest/ethereum/portal_manager.d.ts.map +1 -1
- package/dest/ethereum/portal_manager.js +40 -14
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts +2 -2
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
- package/dest/fee/fee_juice_payment_method_with_claim.js +3 -3
- package/dest/fee/fee_payment_method.d.ts +2 -2
- package/dest/fee/fee_payment_method.d.ts.map +1 -1
- package/dest/fee/private_fee_payment_method.d.ts +2 -2
- 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 +2 -2
- package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/public_fee_payment_method.js +4 -4
- package/dest/fee/sponsored_fee_payment.d.ts +2 -2
- package/dest/fee/sponsored_fee_payment.d.ts.map +1 -1
- package/dest/fee/sponsored_fee_payment.js +2 -2
- 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 +7 -7
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +22 -11
- package/dest/utils/cross_chain.d.ts +2 -2
- package/dest/utils/cross_chain.d.ts.map +1 -1
- package/dest/utils/fee_juice.d.ts +2 -2
- package/dest/utils/fee_juice.js +2 -2
- package/dest/utils/field_compressed_string.d.ts +1 -1
- package/dest/utils/field_compressed_string.d.ts.map +1 -1
- package/dest/utils/field_compressed_string.js +1 -1
- package/dest/utils/node.d.ts +2 -2
- package/dest/utils/node.d.ts.map +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 +2 -3
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +2 -2
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -1
- package/dest/wallet/account_entrypoint_meta_payment_method.js +2 -2
- package/dest/wallet/account_manager.d.ts +2 -5
- package/dest/wallet/account_manager.d.ts.map +1 -1
- package/dest/wallet/account_manager.js +2 -2
- package/dest/wallet/deploy_account_method.d.ts +5 -5
- package/dest/wallet/deploy_account_method.d.ts.map +1 -1
- package/dest/wallet/deploy_account_method.js +2 -2
- package/dest/wallet/index.d.ts +1 -2
- package/dest/wallet/index.d.ts.map +1 -1
- package/dest/wallet/index.js +0 -1
- package/dest/wallet/wallet.d.ts +686 -1148
- package/dest/wallet/wallet.d.ts.map +1 -1
- package/dest/wallet/wallet.js +37 -41
- package/package.json +13 -12
- package/src/account/account.ts +2 -3
- 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 +2 -3
- package/src/api/account.ts +1 -0
- package/src/api/contract.ts +4 -3
- package/src/api/fields.ts +2 -1
- package/src/api/note.ts +1 -1
- package/src/api/tx.ts +2 -0
- package/src/api/wallet.ts +5 -7
- package/src/authorization/call_authorization_request.ts +1 -1
- package/src/contract/base_contract_interaction.ts +2 -3
- package/src/contract/batch_call.ts +65 -48
- package/src/contract/contract.ts +7 -5
- package/src/contract/contract_base.ts +5 -15
- package/src/contract/contract_function_interaction.ts +10 -11
- package/src/contract/deploy_method.ts +13 -12
- package/src/contract/deploy_sent_tx.ts +17 -10
- package/src/contract/interaction_options.ts +5 -11
- package/src/contract/sent_tx.ts +2 -3
- package/src/contract/unsafe_contract.ts +1 -1
- package/src/deployment/broadcast_function.ts +1 -1
- package/src/deployment/contract_deployer.ts +3 -2
- package/src/deployment/publish_class.ts +1 -1
- package/src/ethereum/portal_manager.ts +58 -28
- package/src/fee/fee_juice_payment_method_with_claim.ts +4 -2
- package/src/fee/fee_payment_method.ts +1 -1
- package/src/fee/private_fee_payment_method.ts +5 -3
- package/src/fee/public_fee_payment_method.ts +5 -3
- package/src/fee/sponsored_fee_payment.ts +3 -1
- package/src/utils/abi_types.ts +1 -1
- package/src/utils/authwit.ts +21 -15
- package/src/utils/cross_chain.ts +1 -1
- package/src/utils/fee_juice.ts +2 -2
- package/src/utils/field_compressed_string.ts +1 -1
- package/src/utils/pub_key.ts +3 -4
- package/src/wallet/account_entrypoint_meta_payment_method.ts +2 -1
- package/src/wallet/account_manager.ts +2 -2
- package/src/wallet/deploy_account_method.ts +4 -3
- package/src/wallet/index.ts +0 -1
- package/src/wallet/wallet.ts +81 -80
- package/dest/wallet/base_wallet.d.ts +0 -91
- package/dest/wallet/base_wallet.d.ts.map +0 -1
- package/dest/wallet/base_wallet.js +0 -238
- package/src/wallet/base_wallet.ts +0 -350
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAA6B,MAAM,iCAAiC,CAAC;AACzF,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,gBAAgB,EAErB,KAAK,uBAA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et.js
CHANGED
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BlockNumberPositiveSchema } from '@aztec/foundation/branded-types';
|
|
2
|
+
import { AbiTypeSchema, ContractArtifactSchema, FunctionType } from '@aztec/stdlib/abi';
|
|
2
3
|
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
3
4
|
import { ContractClassWithIdSchema, ContractInstanceWithAddressSchema } from '@aztec/stdlib/contract';
|
|
4
5
|
import { Gas } from '@aztec/stdlib/gas';
|
|
5
|
-
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
6
6
|
import { AbiDecodedSchema, optional, schemas } from '@aztec/stdlib/schemas';
|
|
7
|
-
import { Capsule, HashedValues, TxHash, TxProfileResult, TxReceipt, TxSimulationResult, UtilitySimulationResult } from '@aztec/stdlib/tx';
|
|
7
|
+
import { Capsule, HashedValues, TxHash, TxProfileResult, TxReceipt, TxSimulationResult, UtilitySimulationResult, inTxSchema } from '@aztec/stdlib/tx';
|
|
8
8
|
import { z } from 'zod';
|
|
9
|
-
export const ContractInstantiationDataSchema = z.object({
|
|
10
|
-
constructorArtifact: optional(z.union([
|
|
11
|
-
FunctionAbiSchema,
|
|
12
|
-
z.string()
|
|
13
|
-
])),
|
|
14
|
-
constructorArgs: optional(z.array(z.any())),
|
|
15
|
-
skipArgsDecoding: optional(z.boolean()),
|
|
16
|
-
salt: schemas.Fr,
|
|
17
|
-
publicKeys: optional(PublicKeys.schema),
|
|
18
|
-
deployer: optional(schemas.AztecAddress)
|
|
19
|
-
});
|
|
20
9
|
export const FunctionCallSchema = z.object({
|
|
21
10
|
name: z.string(),
|
|
22
11
|
to: schemas.AztecAddress,
|
|
@@ -31,9 +20,10 @@ export const ExecutionPayloadSchema = z.object({
|
|
|
31
20
|
calls: z.array(FunctionCallSchema),
|
|
32
21
|
authWitnesses: z.array(AuthWitness.schema),
|
|
33
22
|
capsules: z.array(Capsule.schema),
|
|
34
|
-
extraHashedArgs: z.array(HashedValues.schema)
|
|
23
|
+
extraHashedArgs: z.array(HashedValues.schema),
|
|
24
|
+
feePayer: optional(schemas.AztecAddress)
|
|
35
25
|
});
|
|
36
|
-
export const
|
|
26
|
+
export const GasSettingsOptionSchema = z.object({
|
|
37
27
|
gasSettings: optional(z.object({
|
|
38
28
|
gasLimits: optional(Gas.schema),
|
|
39
29
|
teardownGasLimits: optional(Gas.schema),
|
|
@@ -45,10 +35,9 @@ export const UserFeeOptionsSchema = z.object({
|
|
|
45
35
|
feePerDaGas: schemas.BigInt,
|
|
46
36
|
feePerL2Gas: schemas.BigInt
|
|
47
37
|
}))
|
|
48
|
-
}))
|
|
49
|
-
embeddedPaymentMethodFeePayer: optional(schemas.AztecAddress)
|
|
38
|
+
}))
|
|
50
39
|
});
|
|
51
|
-
export const WalletSimulationFeeOptionSchema =
|
|
40
|
+
export const WalletSimulationFeeOptionSchema = GasSettingsOptionSchema.extend({
|
|
52
41
|
estimatedGasPadding: optional(z.number()),
|
|
53
42
|
estimateGas: optional(z.boolean())
|
|
54
43
|
});
|
|
@@ -56,7 +45,7 @@ export const SendOptionsSchema = z.object({
|
|
|
56
45
|
from: schemas.AztecAddress,
|
|
57
46
|
authWitnesses: optional(z.array(AuthWitness.schema)),
|
|
58
47
|
capsules: optional(z.array(Capsule.schema)),
|
|
59
|
-
fee: optional(
|
|
48
|
+
fee: optional(GasSettingsOptionSchema)
|
|
60
49
|
});
|
|
61
50
|
export const SimulateOptionsSchema = z.object({
|
|
62
51
|
from: schemas.AztecAddress,
|
|
@@ -75,24 +64,11 @@ export const ProfileOptionsSchema = SimulateOptionsSchema.extend({
|
|
|
75
64
|
]),
|
|
76
65
|
skipProofGeneration: optional(z.boolean())
|
|
77
66
|
});
|
|
78
|
-
export const InstanceDataSchema = z.union([
|
|
79
|
-
schemas.AztecAddress,
|
|
80
|
-
ContractInstanceWithAddressSchema,
|
|
81
|
-
ContractInstantiationDataSchema,
|
|
82
|
-
z.object({
|
|
83
|
-
instance: ContractInstanceWithAddressSchema,
|
|
84
|
-
artifact: ContractArtifactSchema
|
|
85
|
-
})
|
|
86
|
-
]);
|
|
87
67
|
export const MessageHashOrIntentSchema = z.union([
|
|
88
68
|
schemas.Fr,
|
|
89
|
-
schemas.Buffer,
|
|
90
69
|
z.object({
|
|
91
70
|
consumer: schemas.AztecAddress,
|
|
92
|
-
innerHash:
|
|
93
|
-
schemas.Buffer,
|
|
94
|
-
schemas.Fr
|
|
95
|
-
])
|
|
71
|
+
innerHash: schemas.Fr
|
|
96
72
|
}),
|
|
97
73
|
z.object({
|
|
98
74
|
caller: schemas.AztecAddress,
|
|
@@ -110,7 +86,7 @@ export const BatchedMethodSchema = z.union([
|
|
|
110
86
|
z.object({
|
|
111
87
|
name: z.literal('registerContract'),
|
|
112
88
|
args: z.tuple([
|
|
113
|
-
|
|
89
|
+
ContractInstanceWithAddressSchema,
|
|
114
90
|
optional(ContractArtifactSchema),
|
|
115
91
|
optional(schemas.Fr)
|
|
116
92
|
])
|
|
@@ -125,11 +101,16 @@ export const BatchedMethodSchema = z.union([
|
|
|
125
101
|
z.object({
|
|
126
102
|
name: z.literal('simulateUtility'),
|
|
127
103
|
args: z.tuple([
|
|
128
|
-
|
|
129
|
-
z.array(z.any()),
|
|
130
|
-
schemas.AztecAddress,
|
|
104
|
+
FunctionCallSchema,
|
|
131
105
|
optional(z.array(AuthWitness.schema))
|
|
132
106
|
])
|
|
107
|
+
}),
|
|
108
|
+
z.object({
|
|
109
|
+
name: z.literal('simulateTx'),
|
|
110
|
+
args: z.tuple([
|
|
111
|
+
ExecutionPayloadSchema,
|
|
112
|
+
SimulateOptionsSchema
|
|
113
|
+
])
|
|
133
114
|
})
|
|
134
115
|
]);
|
|
135
116
|
export const ContractMetadataSchema = z.object({
|
|
@@ -156,6 +137,17 @@ export const EventMetadataDefinitionSchema = z.object({
|
|
|
156
137
|
abiType: AbiTypeSchema,
|
|
157
138
|
fieldNames: z.array(z.string())
|
|
158
139
|
});
|
|
140
|
+
export const PrivateEventSchema = z.object({
|
|
141
|
+
event: AbiDecodedSchema,
|
|
142
|
+
metadata: inTxSchema()
|
|
143
|
+
});
|
|
144
|
+
export const PrivateEventFilterSchema = z.object({
|
|
145
|
+
contractAddress: schemas.AztecAddress,
|
|
146
|
+
scopes: z.array(schemas.AztecAddress),
|
|
147
|
+
txHash: optional(TxHash.schema),
|
|
148
|
+
fromBlock: optional(BlockNumberPositiveSchema),
|
|
149
|
+
toBlock: optional(BlockNumberPositiveSchema)
|
|
150
|
+
});
|
|
159
151
|
export const WalletSchema = {
|
|
160
152
|
getChainInfo: z.function().args().returns(z.object({
|
|
161
153
|
chainId: schemas.Fr,
|
|
@@ -164,7 +156,7 @@ export const WalletSchema = {
|
|
|
164
156
|
getContractClassMetadata: z.function().args(schemas.Fr, optional(z.boolean())).returns(ContractClassMetadataSchema),
|
|
165
157
|
getContractMetadata: z.function().args(schemas.AztecAddress).returns(ContractMetadataSchema),
|
|
166
158
|
getTxReceipt: z.function().args(TxHash.schema).returns(TxReceipt.schema),
|
|
167
|
-
getPrivateEvents: z.function().args(
|
|
159
|
+
getPrivateEvents: z.function().args(EventMetadataDefinitionSchema, PrivateEventFilterSchema).returns(z.array(PrivateEventSchema)),
|
|
168
160
|
registerSender: z.function().args(schemas.AztecAddress, optional(z.string())).returns(schemas.AztecAddress),
|
|
169
161
|
getAddressBook: z.function().args().returns(z.array(z.object({
|
|
170
162
|
alias: z.string(),
|
|
@@ -174,9 +166,9 @@ export const WalletSchema = {
|
|
|
174
166
|
alias: z.string(),
|
|
175
167
|
item: schemas.AztecAddress
|
|
176
168
|
}))),
|
|
177
|
-
registerContract: z.function().args(
|
|
169
|
+
registerContract: z.function().args(ContractInstanceWithAddressSchema, optional(ContractArtifactSchema), optional(schemas.Fr)).returns(ContractInstanceWithAddressSchema),
|
|
178
170
|
simulateTx: z.function().args(ExecutionPayloadSchema, SimulateOptionsSchema).returns(TxSimulationResult.schema),
|
|
179
|
-
simulateUtility: z.function().args(
|
|
171
|
+
simulateUtility: z.function().args(FunctionCallSchema, optional(z.array(AuthWitness.schema))).returns(UtilitySimulationResult.schema),
|
|
180
172
|
profileTx: z.function().args(ExecutionPayloadSchema, ProfileOptionsSchema).returns(TxProfileResult.schema),
|
|
181
173
|
sendTx: z.function().args(ExecutionPayloadSchema, SendOptionsSchema).returns(TxHash.schema),
|
|
182
174
|
createAuthWit: z.function().args(schemas.AztecAddress, MessageHashOrIntentSchema).returns(AuthWitness.schema),
|
|
@@ -197,6 +189,10 @@ export const WalletSchema = {
|
|
|
197
189
|
z.object({
|
|
198
190
|
name: z.literal('simulateUtility'),
|
|
199
191
|
result: UtilitySimulationResult.schema
|
|
192
|
+
}),
|
|
193
|
+
z.object({
|
|
194
|
+
name: z.literal('simulateTx'),
|
|
195
|
+
result: TxSimulationResult.schema
|
|
200
196
|
})
|
|
201
197
|
])))
|
|
202
198
|
};
|
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": "3.0.0-devnet.2",
|
|
4
|
+
"version": "3.0.0-devnet.2-patch.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./abi": "./dest/api/abi.js",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"tsconfig": "./tsconfig.json"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
|
-
"build": "yarn clean && tsc
|
|
40
|
-
"build:dev": "tsc
|
|
41
|
-
"build:ts": "
|
|
39
|
+
"build": "yarn clean && ../scripts/tsc.sh",
|
|
40
|
+
"build:dev": "../scripts/tsc.sh --watch",
|
|
41
|
+
"build:ts": "tsgo -b",
|
|
42
42
|
"clean": "rm -rf ./dest .tsbuildinfo ./src/account_contract/artifacts",
|
|
43
43
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
44
44
|
},
|
|
@@ -84,22 +84,23 @@
|
|
|
84
84
|
]
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@aztec/constants": "3.0.0-devnet.2",
|
|
88
|
-
"@aztec/entrypoints": "3.0.0-devnet.2",
|
|
89
|
-
"@aztec/ethereum": "3.0.0-devnet.2",
|
|
90
|
-
"@aztec/foundation": "3.0.0-devnet.2",
|
|
91
|
-
"@aztec/l1-artifacts": "3.0.0-devnet.2",
|
|
92
|
-
"@aztec/protocol-contracts": "3.0.0-devnet.2",
|
|
93
|
-
"@aztec/stdlib": "3.0.0-devnet.2",
|
|
87
|
+
"@aztec/constants": "3.0.0-devnet.2-patch.1",
|
|
88
|
+
"@aztec/entrypoints": "3.0.0-devnet.2-patch.1",
|
|
89
|
+
"@aztec/ethereum": "3.0.0-devnet.2-patch.1",
|
|
90
|
+
"@aztec/foundation": "3.0.0-devnet.2-patch.1",
|
|
91
|
+
"@aztec/l1-artifacts": "3.0.0-devnet.2-patch.1",
|
|
92
|
+
"@aztec/protocol-contracts": "3.0.0-devnet.2-patch.1",
|
|
93
|
+
"@aztec/stdlib": "3.0.0-devnet.2-patch.1",
|
|
94
94
|
"axios": "^1.12.0",
|
|
95
95
|
"tslib": "^2.4.0",
|
|
96
|
-
"viem": "npm:@
|
|
96
|
+
"viem": "npm:@aztec/viem@2.38.2",
|
|
97
97
|
"zod": "^3.23.8"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
100
100
|
"@jest/globals": "^30.0.0",
|
|
101
101
|
"@types/jest": "^30.0.0",
|
|
102
102
|
"@types/node": "^22.15.17",
|
|
103
|
+
"@typescript/native-preview": "7.0.0-dev.20251126.1",
|
|
103
104
|
"buffer": "^6.0.3",
|
|
104
105
|
"crypto-browserify": "^3.12.1",
|
|
105
106
|
"jest": "^30.0.0",
|
package/src/account/account.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
|
|
2
|
-
import
|
|
3
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
3
|
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
5
4
|
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
6
|
-
import type { TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
5
|
+
import type { ExecutionPayload, TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
7
6
|
|
|
8
7
|
import { type CallIntent, type IntentInnerHash, computeAuthWitMessageHash } from '../utils/authwit.js';
|
|
9
8
|
import type { AccountInterface } from './interface.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AuthWitnessProvider, ChainInfo } from '@aztec/entrypoints/interfaces';
|
|
2
|
-
import { Fr } from '@aztec/foundation/
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
4
4
|
import type { CompleteAddress } from '@aztec/stdlib/contract';
|
|
5
5
|
import { getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
|
package/src/account/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
|
-
import type { Fr } from '@aztec/foundation/
|
|
6
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
7
7
|
|
|
8
8
|
export { type AccountContract, getAccountContractAddress } from './account_contract.js';
|
|
9
9
|
export { type AccountInterface } from './interface.js';
|
package/src/account/interface.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AuthWitnessProvider, EntrypointInterface } from '@aztec/entrypoints/interfaces';
|
|
2
|
-
import type { Fr } from '@aztec/foundation/
|
|
2
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import type { CompleteAddress } from '@aztec/stdlib/contract';
|
|
5
5
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { ChainInfo, EntrypointInterface } from '@aztec/entrypoints/interfaces';
|
|
2
2
|
import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
|
|
3
|
-
import type {
|
|
4
|
-
import type { Fr } from '@aztec/foundation/fields';
|
|
3
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
4
|
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
6
5
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
6
|
import type { CompleteAddress } from '@aztec/stdlib/contract';
|
|
8
7
|
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
9
|
-
import type { TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
8
|
+
import type { ExecutionPayload, TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
10
9
|
|
|
11
10
|
import type { CallIntent, IntentInnerHash } from '../utils/authwit.js';
|
|
12
11
|
import type { Account } from './account.js';
|
package/src/api/account.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { type AccountContract, type AccountInterface, type Salt, getAccountContractAddress } from '../account/index.js';
|
|
2
2
|
export type { AuthWitnessProvider, ChainInfo } from '@aztec/entrypoints/interfaces';
|
|
3
|
+
export { ChainInfoSchema } from '@aztec/entrypoints/interfaces';
|
|
3
4
|
|
|
4
5
|
export { AccountWithSecretKey } from '../account/account_with_secret_key.js';
|
|
5
6
|
export { type Account, BaseAccount } from '../account/account.js';
|
package/src/api/contract.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/aztec-nr/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
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* ```
|
|
16
16
|
*
|
|
17
17
|
* ```ts
|
|
18
|
-
* const contract =
|
|
18
|
+
* const contract = Contract.at(address, MyContractArtifact, wallet);
|
|
19
19
|
* await contract.methods.mint(1000, owner).send().wait();
|
|
20
20
|
* console.log(`Total supply is now ${await contract.methods.totalSupply().simulate()}`);
|
|
21
21
|
* ```
|
|
@@ -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/aztec-nr/how_to_compile_contract#use-generated-interfaces | autogenerated type-safe interfaces}
|
|
34
34
|
* for interacting with your contracts.
|
|
35
35
|
*
|
|
36
36
|
* @packageDocumentation
|
|
@@ -44,6 +44,7 @@ export {
|
|
|
44
44
|
type ProfileInteractionOptions,
|
|
45
45
|
type SimulateInteractionOptions,
|
|
46
46
|
type InteractionFeeOptions,
|
|
47
|
+
type GasSettingsOption,
|
|
47
48
|
toProfileOptions,
|
|
48
49
|
toSendOptions,
|
|
49
50
|
toSimulateOptions,
|
package/src/api/fields.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Fr, Fq } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
export { GrumpkinScalar, Point } from '@aztec/foundation/curves/grumpkin';
|
package/src/api/note.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Comparator, Note } from '@aztec/stdlib/note';
|
package/src/api/tx.ts
CHANGED
package/src/api/wallet.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export {
|
|
2
2
|
type Aliased,
|
|
3
|
-
type ContractInstanceAndArtifact,
|
|
4
|
-
type UserFeeOptions,
|
|
5
3
|
type SimulateOptions,
|
|
6
4
|
type ProfileOptions,
|
|
7
5
|
type SendOptions,
|
|
@@ -11,25 +9,25 @@ export {
|
|
|
11
9
|
type BatchedMethodResultWrapper,
|
|
12
10
|
type BatchResults,
|
|
13
11
|
type Wallet,
|
|
14
|
-
|
|
12
|
+
type PrivateEvent,
|
|
13
|
+
type PrivateEventFilter,
|
|
15
14
|
FunctionCallSchema,
|
|
16
15
|
ExecutionPayloadSchema,
|
|
17
|
-
|
|
16
|
+
GasSettingsOptionSchema,
|
|
18
17
|
WalletSimulationFeeOptionSchema,
|
|
19
18
|
SendOptionsSchema,
|
|
20
19
|
SimulateOptionsSchema,
|
|
21
20
|
ProfileOptionsSchema,
|
|
22
|
-
InstanceDataSchema,
|
|
23
21
|
MessageHashOrIntentSchema,
|
|
24
22
|
BatchedMethodSchema,
|
|
25
23
|
ContractMetadataSchema,
|
|
26
24
|
ContractClassMetadataSchema,
|
|
27
25
|
EventMetadataDefinitionSchema,
|
|
26
|
+
PrivateEventSchema,
|
|
27
|
+
PrivateEventFilterSchema,
|
|
28
28
|
WalletSchema,
|
|
29
29
|
} from '../wallet/wallet.js';
|
|
30
30
|
|
|
31
|
-
export { type FeeOptions, BaseWallet } from '../wallet/base_wallet.js';
|
|
32
|
-
|
|
33
31
|
export { AccountManager } from '../wallet/account_manager.js';
|
|
34
32
|
|
|
35
33
|
export { type DeployAccountOptions, DeployAccountMethod } from '../wallet/deploy_account_method.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Fr } from '@aztec/foundation/
|
|
1
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import { FieldReader } from '@aztec/foundation/serialize';
|
|
3
3
|
import { AuthorizationSelector, FunctionSelector } from '@aztec/stdlib/abi';
|
|
4
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
2
1
|
import { createLogger } from '@aztec/foundation/log';
|
|
3
2
|
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
4
|
-
import type { Capsule } from '@aztec/stdlib/tx';
|
|
3
|
+
import type { Capsule, ExecutionPayload } from '@aztec/stdlib/tx';
|
|
5
4
|
|
|
6
5
|
import type { Wallet } from '../wallet/wallet.js';
|
|
7
6
|
import { type RequestInteractionOptions, type SendInteractionOptions, toSendOptions } from './interaction_options.js';
|
|
@@ -42,7 +41,7 @@ export abstract class BaseContractInteraction {
|
|
|
42
41
|
// docs:end:send
|
|
43
42
|
const sendTx = async () => {
|
|
44
43
|
const executionPayload = await this.request(options);
|
|
45
|
-
const sendOptions =
|
|
44
|
+
const sendOptions = toSendOptions(options);
|
|
46
45
|
return this.wallet.sendTx(executionPayload, sendOptions);
|
|
47
46
|
};
|
|
48
47
|
return new SentTx(this.wallet, sendTx);
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/entrypoints/payload';
|
|
2
1
|
import { type FunctionCall, FunctionType, decodeFromAbi } from '@aztec/stdlib/abi';
|
|
2
|
+
import {
|
|
3
|
+
ExecutionPayload,
|
|
4
|
+
TxSimulationResult,
|
|
5
|
+
UtilitySimulationResult,
|
|
6
|
+
mergeExecutionPayloads,
|
|
7
|
+
} from '@aztec/stdlib/tx';
|
|
3
8
|
|
|
4
|
-
import type { Wallet } from '../wallet/wallet.js';
|
|
9
|
+
import type { BatchedMethod, Wallet } from '../wallet/wallet.js';
|
|
5
10
|
import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
6
11
|
import {
|
|
7
12
|
type RequestInteractionOptions,
|
|
@@ -35,13 +40,12 @@ export class BatchCall extends BaseContractInteraction {
|
|
|
35
40
|
}
|
|
36
41
|
|
|
37
42
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* @
|
|
44
|
-
* @returns The result of the transaction as returned by the contract function.
|
|
43
|
+
* Simulates the batch, supporting private, public and utility functions. Although this is a single
|
|
44
|
+
* interaction with the wallet, private and public functions will be grouped into a single ExecutionPayload
|
|
45
|
+
* that the wallet will simulate as a single transaction. Utility function calls will simply be executed
|
|
46
|
+
* one by one.
|
|
47
|
+
* @param options - An optional object containing additional configuration for the interaction.
|
|
48
|
+
* @returns The results of all the interactions that make up the batch
|
|
45
49
|
*/
|
|
46
50
|
public async simulate(options: SimulateInteractionOptions): Promise<any> {
|
|
47
51
|
const { indexedExecutionPayloads, utility } = (await this.getExecutionPayloads()).reduce<{
|
|
@@ -70,52 +74,65 @@ export class BatchCall extends BaseContractInteraction {
|
|
|
70
74
|
{ indexedExecutionPayloads: [], utility: [], publicIndex: 0, privateIndex: 0 },
|
|
71
75
|
);
|
|
72
76
|
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
const batchRequests: Array<BatchedMethod<'simulateUtility'> | BatchedMethod<'simulateTx'>> = [];
|
|
78
|
+
|
|
79
|
+
// Add utility calls to batch
|
|
80
|
+
for (const [call] of utility) {
|
|
81
|
+
batchRequests.push({
|
|
82
|
+
name: 'simulateUtility' as const,
|
|
83
|
+
args: [call, options?.authWitnesses] as const,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
81
86
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
// Add tx simulation to batch if there are any private/public calls
|
|
88
|
+
if (indexedExecutionPayloads.length > 0) {
|
|
89
|
+
const payloads = indexedExecutionPayloads.map(([request]) => request);
|
|
90
|
+
const combinedPayload = mergeExecutionPayloads(payloads);
|
|
91
|
+
const executionPayload = new ExecutionPayload(
|
|
92
|
+
combinedPayload.calls,
|
|
93
|
+
combinedPayload.authWitnesses.concat(options.authWitnesses ?? []),
|
|
94
|
+
combinedPayload.capsules.concat(options.capsules ?? []),
|
|
95
|
+
combinedPayload.extraHashedArgs,
|
|
96
|
+
);
|
|
91
97
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
batchRequests.push({
|
|
99
|
+
name: 'simulateTx' as const,
|
|
100
|
+
args: [executionPayload, toSimulateOptions(options)],
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const batchResults = batchRequests.length > 0 ? await this.wallet.batch(batchRequests) : [];
|
|
98
105
|
|
|
99
106
|
const results: any[] = [];
|
|
100
107
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
108
|
+
// Process utility results (they come first in batch results)
|
|
109
|
+
for (let i = 0; i < utility.length; i++) {
|
|
110
|
+
const [call, resultIndex] = utility[i];
|
|
111
|
+
const wrappedResult = batchResults[i];
|
|
112
|
+
if (wrappedResult.name === 'simulateUtility') {
|
|
113
|
+
const rawReturnValues = (wrappedResult.result as UtilitySimulationResult).result;
|
|
114
|
+
results[resultIndex] = rawReturnValues ? decodeFromAbi(call.returnTypes, rawReturnValues) : [];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
105
117
|
|
|
106
|
-
if
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
118
|
+
// Process tx simulation result (it comes last if present)
|
|
119
|
+
if (indexedExecutionPayloads.length > 0) {
|
|
120
|
+
const txResultWrapper = batchResults[utility.length];
|
|
121
|
+
if (txResultWrapper.name === 'simulateTx') {
|
|
122
|
+
const simulatedTx = txResultWrapper.result as TxSimulationResult;
|
|
123
|
+
indexedExecutionPayloads.forEach(([request, callIndex, resultIndex]) => {
|
|
124
|
+
const call = request.calls[0];
|
|
125
|
+
// As account entrypoints are private, for private functions we retrieve the return values from the first nested call
|
|
126
|
+
// since we're interested in the first set of values AFTER the account entrypoint
|
|
127
|
+
// For public functions we retrieve the first values directly from the public output.
|
|
128
|
+
const rawReturnValues =
|
|
129
|
+
call.type == FunctionType.PRIVATE
|
|
130
|
+
? simulatedTx.getPrivateReturnValues()?.nested?.[resultIndex].values
|
|
131
|
+
: simulatedTx.getPublicReturnValues()?.[resultIndex].values;
|
|
116
132
|
|
|
117
|
-
|
|
118
|
-
|
|
133
|
+
results[callIndex] = rawReturnValues ? decodeFromAbi(call.returnTypes, rawReturnValues) : [];
|
|
134
|
+
});
|
|
135
|
+
}
|
|
119
136
|
}
|
|
120
137
|
|
|
121
138
|
return results;
|
package/src/contract/contract.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
2
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
+
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
3
4
|
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
4
5
|
|
|
5
6
|
import type { Wallet } from '../wallet/wallet.js';
|
|
@@ -21,9 +22,8 @@ export class Contract extends ContractBase {
|
|
|
21
22
|
* @param wallet - The wallet to use when interacting with the contract.
|
|
22
23
|
* @returns A promise that resolves to a new Contract instance.
|
|
23
24
|
*/
|
|
24
|
-
public static
|
|
25
|
-
|
|
26
|
-
return new Contract(instance, artifact, wallet);
|
|
25
|
+
public static at(address: AztecAddress, artifact: ContractArtifact, wallet: Wallet): Contract {
|
|
26
|
+
return new Contract(address, artifact, wallet);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/**
|
|
@@ -34,7 +34,8 @@ export class Contract extends ContractBase {
|
|
|
34
34
|
* @param constructorName - The name of the constructor function to call.
|
|
35
35
|
*/
|
|
36
36
|
public static deploy(wallet: Wallet, artifact: ContractArtifact, args: any[], constructorName?: string) {
|
|
37
|
-
const postDeployCtor = (
|
|
37
|
+
const postDeployCtor = (instance: ContractInstanceWithAddress, wallet: Wallet) =>
|
|
38
|
+
Contract.at(instance.address, artifact, wallet);
|
|
38
39
|
return new DeployMethod(PublicKeys.default(), wallet, artifact, postDeployCtor, args, constructorName);
|
|
39
40
|
}
|
|
40
41
|
|
|
@@ -54,7 +55,8 @@ export class Contract extends ContractBase {
|
|
|
54
55
|
args: any[],
|
|
55
56
|
constructorName?: string,
|
|
56
57
|
) {
|
|
57
|
-
const postDeployCtor = (
|
|
58
|
+
const postDeployCtor = (instance: ContractInstanceWithAddress, wallet: Wallet) =>
|
|
59
|
+
Contract.at(instance.address, artifact, wallet);
|
|
58
60
|
return new DeployMethod(publicKeys, wallet, artifact, postDeployCtor, args, constructorName);
|
|
59
61
|
}
|
|
60
62
|
}
|