@aztec/aztec.js 0.0.1-commit.29c6b1a3 → 0.0.1-commit.2c85e299c
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/abi.d.ts +2 -2
- package/dest/api/abi.d.ts.map +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/deployment.d.ts +1 -2
- package/dest/api/deployment.d.ts.map +1 -1
- package/dest/api/deployment.js +0 -1
- package/dest/api/events.d.ts +18 -6
- package/dest/api/events.d.ts.map +1 -1
- package/dest/api/events.js +37 -22
- package/dest/api/fields.d.ts +2 -1
- package/dest/api/fields.d.ts.map +1 -1
- package/dest/api/fields.js +1 -0
- package/dest/api/keys.d.ts +1 -1
- package/dest/api/keys.js +1 -1
- package/dest/api/wallet.d.ts +3 -2
- package/dest/api/wallet.d.ts.map +1 -1
- package/dest/api/wallet.js +2 -1
- package/dest/contract/base_contract_interaction.d.ts +3 -3
- package/dest/contract/base_contract_interaction.d.ts.map +1 -1
- 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 +17 -8
- package/dest/contract/contract_function_interaction.d.ts +7 -16
- package/dest/contract/contract_function_interaction.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.js +107 -18
- package/dest/contract/deploy_method.d.ts +37 -12
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +42 -21
- package/dest/contract/get_gas_limits.js +3 -3
- package/dest/contract/interaction_options.d.ts +62 -21
- package/dest/contract/interaction_options.d.ts.map +1 -1
- package/dest/contract/interaction_options.js +33 -0
- package/dest/contract/protocol_contracts/auth-registry.d.ts +1 -1
- package/dest/contract/protocol_contracts/auth-registry.d.ts.map +1 -1
- package/dest/contract/protocol_contracts/auth-registry.js +48 -6
- package/dest/contract/protocol_contracts/contract-class-registry.d.ts +2 -22
- package/dest/contract/protocol_contracts/contract-class-registry.d.ts.map +1 -1
- package/dest/contract/protocol_contracts/contract-class-registry.js +13 -658
- package/dest/contract/protocol_contracts/contract-instance-registry.d.ts +2 -11
- package/dest/contract/protocol_contracts/contract-instance-registry.d.ts.map +1 -1
- package/dest/contract/protocol_contracts/contract-instance-registry.js +76 -473
- package/dest/contract/protocol_contracts/fee-juice.d.ts +1 -10
- package/dest/contract/protocol_contracts/fee-juice.d.ts.map +1 -1
- package/dest/contract/protocol_contracts/fee-juice.js +7 -400
- package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts +1 -1
- package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts.map +1 -1
- package/dest/contract/protocol_contracts/multi-call-entrypoint.js +39 -1
- package/dest/contract/protocol_contracts/public-checks.d.ts +1 -1
- package/dest/contract/protocol_contracts/public-checks.d.ts.map +1 -1
- package/dest/contract/protocol_contracts/public-checks.js +39 -9
- package/dest/fee/fee_juice_payment_method_with_claim.js +6 -6
- package/dest/fee/private_fee_payment_method.d.ts +2 -1
- package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/private_fee_payment_method.js +11 -10
- package/dest/fee/public_fee_payment_method.d.ts +2 -1
- package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/public_fee_payment_method.js +11 -10
- package/dest/fee/sponsored_fee_payment.js +3 -3
- package/dest/utils/abi_types.d.ts +6 -1
- package/dest/utils/abi_types.d.ts.map +1 -1
- package/dest/utils/abi_types.js +1 -1
- package/dest/utils/authwit.d.ts +5 -5
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +10 -6
- package/dest/utils/cross_chain.d.ts +3 -8
- package/dest/utils/cross_chain.d.ts.map +1 -1
- package/dest/utils/cross_chain.js +8 -15
- package/dest/wallet/capabilities.d.ts +452 -0
- package/dest/wallet/capabilities.d.ts.map +1 -0
- package/dest/wallet/capabilities.js +3 -0
- package/dest/wallet/deploy_account_method.d.ts +15 -4
- package/dest/wallet/deploy_account_method.d.ts.map +1 -1
- package/dest/wallet/deploy_account_method.js +26 -0
- package/dest/wallet/index.d.ts +2 -1
- package/dest/wallet/index.d.ts.map +1 -1
- package/dest/wallet/index.js +1 -0
- package/dest/wallet/wallet.d.ts +1663 -89
- package/dest/wallet/wallet.d.ts.map +1 -1
- package/dest/wallet/wallet.js +175 -27
- package/package.json +20 -11
- package/src/api/abi.ts +1 -0
- package/src/api/contract.ts +10 -3
- package/src/api/deployment.ts +0 -1
- package/src/api/events.ts +50 -32
- package/src/api/fields.ts +1 -0
- package/src/api/keys.ts +2 -2
- package/src/api/wallet.ts +43 -1
- package/src/contract/base_contract_interaction.ts +3 -2
- package/src/contract/batch_call.ts +17 -14
- package/src/contract/contract_function_interaction.ts +114 -26
- package/src/contract/deploy_method.ts +77 -32
- package/src/contract/get_gas_limits.ts +3 -3
- package/src/contract/interaction_options.ts +96 -23
- package/src/contract/protocol_contracts/auth-registry.ts +10 -2
- package/src/contract/protocol_contracts/contract-class-registry.ts +4 -338
- package/src/contract/protocol_contracts/contract-instance-registry.ts +33 -225
- package/src/contract/protocol_contracts/fee-juice.ts +2 -193
- package/src/contract/protocol_contracts/multi-call-entrypoint.ts +8 -1
- package/src/contract/protocol_contracts/public-checks.ts +8 -3
- package/src/fee/fee_juice_payment_method_with_claim.ts +5 -5
- package/src/fee/private_fee_payment_method.ts +8 -7
- package/src/fee/public_fee_payment_method.ts +9 -8
- package/src/fee/sponsored_fee_payment.ts +3 -3
- package/src/utils/abi_types.ts +7 -0
- package/src/utils/authwit.ts +20 -22
- package/src/utils/cross_chain.ts +9 -18
- package/src/wallet/capabilities.ts +500 -0
- package/src/wallet/deploy_account_method.ts +39 -2
- package/src/wallet/index.ts +1 -0
- package/src/wallet/wallet.ts +230 -39
- package/dest/deployment/broadcast_function.d.ts +0 -24
- package/dest/deployment/broadcast_function.d.ts.map +0 -1
- package/dest/deployment/broadcast_function.js +0 -74
- package/src/deployment/broadcast_function.ts +0 -148
|
@@ -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,EAAE,WAAW,EAA6B,MAAM,iCAAiC,CAAC;AACzF,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,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,uBAAuB,EAC5B,YAAY,EACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,KAAK,2BAA2B,EAAqC,MAAM,wBAAwB,CAAC;AAC7G,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAoB,KAAK,YAAY,EAA6B,MAAM,uBAAuB,CAAC;AACvG,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,OAAO,EACP,YAAY,EACZ,MAAM,EACN,eAAe,EAEf,kBAAkB,EAClB,sBAAsB,EAEvB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,K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wallet.js
CHANGED
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
import { BlockNumberPositiveSchema } from '@aztec/foundation/branded-types';
|
|
2
|
-
import { AbiTypeSchema, ContractArtifactSchema,
|
|
2
|
+
import { AbiTypeSchema, ContractArtifactSchema, FunctionCall } from '@aztec/stdlib/abi';
|
|
3
3
|
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
4
4
|
import { ContractInstanceWithAddressSchema } from '@aztec/stdlib/contract';
|
|
5
5
|
import { Gas } from '@aztec/stdlib/gas';
|
|
6
|
+
import { LogId } from '@aztec/stdlib/logs';
|
|
6
7
|
import { AbiDecodedSchema, optional, schemas, zodFor } from '@aztec/stdlib/schemas';
|
|
7
|
-
import { Capsule, HashedValues, TxHash, TxProfileResult, TxReceipt, TxSimulationResult,
|
|
8
|
+
import { Capsule, HashedValues, TxHash, TxProfileResult, TxReceipt, TxSimulationResult, UtilityExecutionResult, inTxSchema } from '@aztec/stdlib/tx';
|
|
8
9
|
import { z } from 'zod';
|
|
9
10
|
import { NO_WAIT } from '../contract/interaction_options.js';
|
|
10
|
-
export const FunctionCallSchema = z.object({
|
|
11
|
-
name: z.string(),
|
|
12
|
-
to: schemas.AztecAddress,
|
|
13
|
-
selector: schemas.FunctionSelector,
|
|
14
|
-
type: z.nativeEnum(FunctionType),
|
|
15
|
-
isStatic: z.boolean(),
|
|
16
|
-
hideMsgSender: z.boolean(),
|
|
17
|
-
args: z.array(schemas.Fr),
|
|
18
|
-
returnTypes: z.array(AbiTypeSchema)
|
|
19
|
-
});
|
|
20
11
|
export const ExecutionPayloadSchema = z.object({
|
|
21
|
-
calls: z.array(
|
|
12
|
+
calls: z.array(FunctionCall.schema),
|
|
22
13
|
authWitnesses: z.array(AuthWitness.schema),
|
|
23
14
|
capsules: z.array(Capsule.schema),
|
|
24
15
|
extraHashedArgs: z.array(HashedValues.schema),
|
|
@@ -56,7 +47,8 @@ export const SendOptionsSchema = z.object({
|
|
|
56
47
|
wait: optional(z.union([
|
|
57
48
|
z.literal(NO_WAIT),
|
|
58
49
|
WaitOptsSchema
|
|
59
|
-
]))
|
|
50
|
+
])),
|
|
51
|
+
additionalScopes: optional(z.array(schemas.AztecAddress))
|
|
60
52
|
});
|
|
61
53
|
export const SimulateOptionsSchema = z.object({
|
|
62
54
|
from: schemas.AztecAddress,
|
|
@@ -65,7 +57,8 @@ export const SimulateOptionsSchema = z.object({
|
|
|
65
57
|
fee: optional(WalletSimulationFeeOptionSchema),
|
|
66
58
|
skipTxValidation: optional(z.boolean()),
|
|
67
59
|
skipFeeEnforcement: optional(z.boolean()),
|
|
68
|
-
includeMetadata: optional(z.boolean())
|
|
60
|
+
includeMetadata: optional(z.boolean()),
|
|
61
|
+
additionalScopes: optional(z.array(schemas.AztecAddress))
|
|
69
62
|
});
|
|
70
63
|
export const ProfileOptionsSchema = SimulateOptionsSchema.extend({
|
|
71
64
|
profileMode: z.enum([
|
|
@@ -82,7 +75,7 @@ export const MessageHashOrIntentSchema = z.union([
|
|
|
82
75
|
}),
|
|
83
76
|
z.object({
|
|
84
77
|
caller: schemas.AztecAddress,
|
|
85
|
-
call:
|
|
78
|
+
call: FunctionCall.schema
|
|
86
79
|
})
|
|
87
80
|
]);
|
|
88
81
|
export const EventMetadataDefinitionSchema = z.object({
|
|
@@ -90,17 +83,29 @@ export const EventMetadataDefinitionSchema = z.object({
|
|
|
90
83
|
abiType: AbiTypeSchema,
|
|
91
84
|
fieldNames: z.array(z.string())
|
|
92
85
|
});
|
|
86
|
+
const EventFilterBaseSchema = z.object({
|
|
87
|
+
txHash: optional(TxHash.schema),
|
|
88
|
+
fromBlock: optional(BlockNumberPositiveSchema),
|
|
89
|
+
toBlock: optional(BlockNumberPositiveSchema),
|
|
90
|
+
afterLog: optional(LogId.schema)
|
|
91
|
+
});
|
|
92
|
+
export const PrivateEventFilterSchema = EventFilterBaseSchema.extend({
|
|
93
|
+
contractAddress: schemas.AztecAddress,
|
|
94
|
+
scopes: z.array(schemas.AztecAddress)
|
|
95
|
+
});
|
|
96
|
+
export const PublicEventFilterSchema = EventFilterBaseSchema.extend({
|
|
97
|
+
contractAddress: optional(schemas.AztecAddress)
|
|
98
|
+
});
|
|
93
99
|
export const PrivateEventSchema = zodFor()(z.object({
|
|
94
100
|
event: AbiDecodedSchema,
|
|
95
101
|
metadata: inTxSchema()
|
|
96
102
|
}));
|
|
97
|
-
export const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
});
|
|
103
|
+
export const PublicEventSchema = zodFor()(z.object({
|
|
104
|
+
event: AbiDecodedSchema,
|
|
105
|
+
metadata: z.intersection(inTxSchema(), z.object({
|
|
106
|
+
contractAddress: schemas.AztecAddress
|
|
107
|
+
}))
|
|
108
|
+
}));
|
|
104
109
|
export const ContractMetadataSchema = z.object({
|
|
105
110
|
instance: optional(ContractInstanceWithAddressSchema),
|
|
106
111
|
isContractInitialized: z.boolean(),
|
|
@@ -112,6 +117,141 @@ export const ContractClassMetadataSchema = z.object({
|
|
|
112
117
|
isArtifactRegistered: z.boolean(),
|
|
113
118
|
isContractClassPubliclyRegistered: z.boolean()
|
|
114
119
|
});
|
|
120
|
+
export const ContractFunctionPatternSchema = z.object({
|
|
121
|
+
contract: z.union([
|
|
122
|
+
schemas.AztecAddress,
|
|
123
|
+
z.literal('*')
|
|
124
|
+
]),
|
|
125
|
+
function: z.union([
|
|
126
|
+
z.string(),
|
|
127
|
+
z.literal('*')
|
|
128
|
+
]),
|
|
129
|
+
additionalScopes: optional(z.union([
|
|
130
|
+
z.array(schemas.AztecAddress),
|
|
131
|
+
z.literal('*')
|
|
132
|
+
]))
|
|
133
|
+
});
|
|
134
|
+
export const AccountsCapabilitySchema = z.object({
|
|
135
|
+
type: z.literal('accounts'),
|
|
136
|
+
canGet: optional(z.boolean()),
|
|
137
|
+
canCreateAuthWit: optional(z.boolean())
|
|
138
|
+
});
|
|
139
|
+
export const GrantedAccountsCapabilitySchema = AccountsCapabilitySchema.extend({
|
|
140
|
+
accounts: z.array(z.object({
|
|
141
|
+
alias: z.string(),
|
|
142
|
+
item: schemas.AztecAddress
|
|
143
|
+
}))
|
|
144
|
+
});
|
|
145
|
+
export const ContractsCapabilitySchema = z.object({
|
|
146
|
+
type: z.literal('contracts'),
|
|
147
|
+
contracts: z.union([
|
|
148
|
+
z.literal('*'),
|
|
149
|
+
z.array(schemas.AztecAddress)
|
|
150
|
+
]),
|
|
151
|
+
canRegister: optional(z.boolean()),
|
|
152
|
+
canGetMetadata: optional(z.boolean())
|
|
153
|
+
});
|
|
154
|
+
export const GrantedContractsCapabilitySchema = ContractsCapabilitySchema;
|
|
155
|
+
export const ContractClassesCapabilitySchema = z.object({
|
|
156
|
+
type: z.literal('contractClasses'),
|
|
157
|
+
classes: z.union([
|
|
158
|
+
z.literal('*'),
|
|
159
|
+
z.array(schemas.Fr)
|
|
160
|
+
]),
|
|
161
|
+
canGetMetadata: z.boolean()
|
|
162
|
+
});
|
|
163
|
+
export const GrantedContractClassesCapabilitySchema = ContractClassesCapabilitySchema;
|
|
164
|
+
export const SimulationCapabilitySchema = z.object({
|
|
165
|
+
type: z.literal('simulation'),
|
|
166
|
+
transactions: optional(z.object({
|
|
167
|
+
scope: z.union([
|
|
168
|
+
z.literal('*'),
|
|
169
|
+
z.array(ContractFunctionPatternSchema)
|
|
170
|
+
])
|
|
171
|
+
})),
|
|
172
|
+
utilities: optional(z.object({
|
|
173
|
+
scope: z.union([
|
|
174
|
+
z.literal('*'),
|
|
175
|
+
z.array(ContractFunctionPatternSchema)
|
|
176
|
+
])
|
|
177
|
+
}))
|
|
178
|
+
});
|
|
179
|
+
export const GrantedSimulationCapabilitySchema = SimulationCapabilitySchema;
|
|
180
|
+
export const TransactionCapabilitySchema = z.object({
|
|
181
|
+
type: z.literal('transaction'),
|
|
182
|
+
scope: z.union([
|
|
183
|
+
z.literal('*'),
|
|
184
|
+
z.array(ContractFunctionPatternSchema)
|
|
185
|
+
])
|
|
186
|
+
});
|
|
187
|
+
export const GrantedTransactionCapabilitySchema = TransactionCapabilitySchema;
|
|
188
|
+
export const DataCapabilitySchema = z.object({
|
|
189
|
+
type: z.literal('data'),
|
|
190
|
+
addressBook: optional(z.boolean()),
|
|
191
|
+
privateEvents: optional(z.object({
|
|
192
|
+
contracts: z.union([
|
|
193
|
+
z.literal('*'),
|
|
194
|
+
z.array(schemas.AztecAddress)
|
|
195
|
+
])
|
|
196
|
+
}))
|
|
197
|
+
});
|
|
198
|
+
export const GrantedDataCapabilitySchema = DataCapabilitySchema;
|
|
199
|
+
export const CapabilitySchema = z.discriminatedUnion('type', [
|
|
200
|
+
AccountsCapabilitySchema,
|
|
201
|
+
ContractsCapabilitySchema,
|
|
202
|
+
ContractClassesCapabilitySchema,
|
|
203
|
+
SimulationCapabilitySchema,
|
|
204
|
+
TransactionCapabilitySchema,
|
|
205
|
+
DataCapabilitySchema
|
|
206
|
+
]);
|
|
207
|
+
export const GrantedCapabilitySchema = z.discriminatedUnion('type', [
|
|
208
|
+
GrantedAccountsCapabilitySchema,
|
|
209
|
+
GrantedContractsCapabilitySchema,
|
|
210
|
+
GrantedContractClassesCapabilitySchema,
|
|
211
|
+
GrantedSimulationCapabilitySchema,
|
|
212
|
+
GrantedTransactionCapabilitySchema,
|
|
213
|
+
GrantedDataCapabilitySchema
|
|
214
|
+
]);
|
|
215
|
+
export const AppCapabilitiesSchema = z.object({
|
|
216
|
+
version: z.literal('1.0'),
|
|
217
|
+
metadata: z.object({
|
|
218
|
+
name: z.string(),
|
|
219
|
+
version: z.string(),
|
|
220
|
+
description: optional(z.string()),
|
|
221
|
+
url: optional(z.string()),
|
|
222
|
+
icon: optional(z.string())
|
|
223
|
+
}),
|
|
224
|
+
capabilities: z.array(CapabilitySchema),
|
|
225
|
+
behavior: optional(z.object({
|
|
226
|
+
mode: optional(z.enum([
|
|
227
|
+
'strict',
|
|
228
|
+
'permissive'
|
|
229
|
+
])),
|
|
230
|
+
expiration: optional(z.number())
|
|
231
|
+
}))
|
|
232
|
+
});
|
|
233
|
+
export const WalletCapabilitiesSchema = z.object({
|
|
234
|
+
version: z.literal('1.0'),
|
|
235
|
+
granted: z.array(GrantedCapabilitySchema),
|
|
236
|
+
wallet: z.object({
|
|
237
|
+
name: z.string(),
|
|
238
|
+
version: z.string()
|
|
239
|
+
}),
|
|
240
|
+
expiresAt: optional(z.number())
|
|
241
|
+
});
|
|
242
|
+
const OffchainEffectSchema = z.object({
|
|
243
|
+
data: z.array(schemas.Fr),
|
|
244
|
+
contractAddress: schemas.AztecAddress
|
|
245
|
+
});
|
|
246
|
+
const OffchainMessageSchema = z.object({
|
|
247
|
+
recipient: schemas.AztecAddress,
|
|
248
|
+
payload: z.array(schemas.Fr),
|
|
249
|
+
contractAddress: schemas.AztecAddress
|
|
250
|
+
});
|
|
251
|
+
const OffchainOutputSchema = z.object({
|
|
252
|
+
offchainEffects: z.array(OffchainEffectSchema),
|
|
253
|
+
offchainMessages: z.array(OffchainMessageSchema)
|
|
254
|
+
});
|
|
115
255
|
/**
|
|
116
256
|
* Record of all wallet method schemas (excluding batch).
|
|
117
257
|
* This is the single source of truth for method schemas - batch schemas are derived from this.
|
|
@@ -134,13 +274,21 @@ export const ContractClassMetadataSchema = z.object({
|
|
|
134
274
|
}))),
|
|
135
275
|
registerContract: z.function().args(ContractInstanceWithAddressSchema, optional(ContractArtifactSchema), optional(schemas.Fr)).returns(ContractInstanceWithAddressSchema),
|
|
136
276
|
simulateTx: z.function().args(ExecutionPayloadSchema, SimulateOptionsSchema).returns(TxSimulationResult.schema),
|
|
137
|
-
|
|
277
|
+
executeUtility: z.function().args(FunctionCall.schema, z.object({
|
|
278
|
+
scope: schemas.AztecAddress,
|
|
279
|
+
authWitnesses: optional(z.array(AuthWitness.schema))
|
|
280
|
+
})).returns(UtilityExecutionResult.schema),
|
|
138
281
|
profileTx: z.function().args(ExecutionPayloadSchema, ProfileOptionsSchema).returns(TxProfileResult.schema),
|
|
139
282
|
sendTx: z.function().args(ExecutionPayloadSchema, SendOptionsSchema).returns(z.union([
|
|
140
|
-
|
|
141
|
-
|
|
283
|
+
z.object({
|
|
284
|
+
txHash: TxHash.schema
|
|
285
|
+
}).merge(OffchainOutputSchema),
|
|
286
|
+
z.object({
|
|
287
|
+
receipt: TxReceipt.schema
|
|
288
|
+
}).merge(OffchainOutputSchema)
|
|
142
289
|
])),
|
|
143
|
-
createAuthWit: z.function().args(schemas.AztecAddress, MessageHashOrIntentSchema).returns(AuthWitness.schema)
|
|
290
|
+
createAuthWit: z.function().args(schemas.AztecAddress, MessageHashOrIntentSchema).returns(AuthWitness.schema),
|
|
291
|
+
requestCapabilities: z.function().args(AppCapabilitiesSchema).returns(WalletCapabilitiesSchema)
|
|
144
292
|
};
|
|
145
293
|
/**
|
|
146
294
|
* Creates batch schemas from the individual wallet methods.
|
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.0.1-commit.
|
|
4
|
+
"version": "0.0.1-commit.2c85e299c",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./abi": "./dest/api/abi.js",
|
|
@@ -30,7 +30,16 @@
|
|
|
30
30
|
},
|
|
31
31
|
"typedocOptions": {
|
|
32
32
|
"entryPoints": [
|
|
33
|
-
"./src/
|
|
33
|
+
"./src/api/abi.ts",
|
|
34
|
+
"./src/api/account.ts",
|
|
35
|
+
"./src/api/contract.ts",
|
|
36
|
+
"./src/api/deployment.ts",
|
|
37
|
+
"./src/api/ethereum.ts",
|
|
38
|
+
"./src/api/fee.ts",
|
|
39
|
+
"./src/api/fields.ts",
|
|
40
|
+
"./src/api/keys.ts",
|
|
41
|
+
"./src/api/tx.ts",
|
|
42
|
+
"./src/api/wallet.ts"
|
|
34
43
|
],
|
|
35
44
|
"name": "Aztec.js",
|
|
36
45
|
"tsconfig": "./tsconfig.json"
|
|
@@ -85,20 +94,20 @@
|
|
|
85
94
|
]
|
|
86
95
|
},
|
|
87
96
|
"dependencies": {
|
|
88
|
-
"@aztec/constants": "0.0.1-commit.
|
|
89
|
-
"@aztec/entrypoints": "0.0.1-commit.
|
|
90
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
91
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
92
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
93
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
94
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
95
|
-
"axios": "^1.
|
|
97
|
+
"@aztec/constants": "0.0.1-commit.2c85e299c",
|
|
98
|
+
"@aztec/entrypoints": "0.0.1-commit.2c85e299c",
|
|
99
|
+
"@aztec/ethereum": "0.0.1-commit.2c85e299c",
|
|
100
|
+
"@aztec/foundation": "0.0.1-commit.2c85e299c",
|
|
101
|
+
"@aztec/l1-artifacts": "0.0.1-commit.2c85e299c",
|
|
102
|
+
"@aztec/protocol-contracts": "0.0.1-commit.2c85e299c",
|
|
103
|
+
"@aztec/stdlib": "0.0.1-commit.2c85e299c",
|
|
104
|
+
"axios": "^1.13.5",
|
|
96
105
|
"tslib": "^2.4.0",
|
|
97
106
|
"viem": "npm:@aztec/viem@2.38.2",
|
|
98
107
|
"zod": "^3.23.8"
|
|
99
108
|
},
|
|
100
109
|
"devDependencies": {
|
|
101
|
-
"@aztec/builder": "0.0.1-commit.
|
|
110
|
+
"@aztec/builder": "0.0.1-commit.2c85e299c",
|
|
102
111
|
"@jest/globals": "^30.0.0",
|
|
103
112
|
"@types/jest": "^30.0.0",
|
|
104
113
|
"@types/node": "^22.15.17",
|
package/src/api/abi.ts
CHANGED
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/aztec-nr/
|
|
4
|
+
* `Wallet` instance, and to the {@link https://docs.aztec.network/developers/aztec-nr/compiling_contracts | 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
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
* If you pass `wait: NO_WAIT` in the options, it will return a {@link TxHash} immediately without waiting.
|
|
38
38
|
*
|
|
39
39
|
* @remarks If you are using typescript, consider using the
|
|
40
|
-
* {@link https://docs.aztec.network/developers/aztec-nr/
|
|
40
|
+
* {@link https://docs.aztec.network/developers/aztec-nr/compiling_contracts#use-generated-interfaces | autogenerated type-safe interfaces}
|
|
41
41
|
* for interacting with your contracts.
|
|
42
42
|
*
|
|
43
43
|
* @packageDocumentation
|
|
@@ -48,6 +48,8 @@ export { ContractFunctionInteraction } from '../contract/contract_function_inter
|
|
|
48
48
|
export {
|
|
49
49
|
NO_WAIT,
|
|
50
50
|
type NoWait,
|
|
51
|
+
type OffchainMessage,
|
|
52
|
+
type OffchainOutput,
|
|
51
53
|
type RequestInteractionOptions,
|
|
52
54
|
type SendInteractionOptions,
|
|
53
55
|
type ProfileInteractionOptions,
|
|
@@ -56,7 +58,11 @@ export {
|
|
|
56
58
|
type InteractionWaitOptions,
|
|
57
59
|
type GasSettingsOption,
|
|
58
60
|
type SendReturn,
|
|
59
|
-
type
|
|
61
|
+
type SimulationResult,
|
|
62
|
+
type TxSendResultImmediate,
|
|
63
|
+
type TxSendResultMined,
|
|
64
|
+
emptyOffchainOutput,
|
|
65
|
+
extractOffchainOutput,
|
|
60
66
|
toProfileOptions,
|
|
61
67
|
toSendOptions,
|
|
62
68
|
toSimulateOptions,
|
|
@@ -67,6 +73,7 @@ export { ContractBase, type ContractMethod, type ContractStorageLayout } from '.
|
|
|
67
73
|
export { BatchCall } from '../contract/batch_call.js';
|
|
68
74
|
export {
|
|
69
75
|
type DeployOptions,
|
|
76
|
+
type DeployResultMined,
|
|
70
77
|
type DeployReturn,
|
|
71
78
|
type DeployTxReceipt,
|
|
72
79
|
type DeployWaitOptions,
|
package/src/api/deployment.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { publishContractClass } from '../deployment/publish_class.js';
|
|
2
|
-
export { broadcastPrivateFunction, broadcastUtilityFunction } from '../deployment/broadcast_function.js';
|
|
3
2
|
export { publishInstance } from '../deployment/publish_instance.js';
|
|
4
3
|
export { ContractDeployer } from '../deployment/contract_deployer.js';
|
package/src/api/events.ts
CHANGED
|
@@ -1,44 +1,62 @@
|
|
|
1
1
|
import { type EventMetadataDefinition, EventSelector, decodeFromAbi } from '@aztec/stdlib/abi';
|
|
2
2
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
3
3
|
|
|
4
|
+
import type { PublicEvent, PublicEventFilter } from '../wallet/wallet.js';
|
|
5
|
+
|
|
6
|
+
/** Result of a paginated public event query. */
|
|
7
|
+
export type GetPublicEventsResult<T> = {
|
|
8
|
+
/** The decoded events with metadata. */
|
|
9
|
+
events: PublicEvent<T>[];
|
|
10
|
+
/** Whether the log limit was reached, indicating more results may be available. */
|
|
11
|
+
maxLogsHit: boolean;
|
|
12
|
+
};
|
|
13
|
+
|
|
4
14
|
/**
|
|
5
15
|
* Returns decoded public events given search parameters.
|
|
6
16
|
* @param node - The node to request events from
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
*
|
|
10
|
-
*
|
|
17
|
+
* @param eventMetadataDef - Metadata of the event. This should be the class generated from the contract. e.g. Contract.events.Event
|
|
18
|
+
* @param filter - Filter options for the event query:
|
|
19
|
+
* - `contractAddress`: The address of the contract that emitted the events.
|
|
20
|
+
* - `txHash`: Transaction in which the events were emitted.
|
|
21
|
+
* - `fromBlock`: The block number from which to start fetching events (inclusive). Defaults to 1.
|
|
22
|
+
* - `toBlock`: The block number until which to fetch events (not inclusive). Defaults to latest + 1.
|
|
23
|
+
* - `afterLog`: Log id after which to start fetching logs. Used for pagination.
|
|
24
|
+
* @returns The decoded events with metadata and a flag indicating if more results are available.
|
|
11
25
|
*/
|
|
12
|
-
export async function
|
|
26
|
+
export async function getPublicEvents<T>(
|
|
13
27
|
node: AztecNode,
|
|
14
28
|
eventMetadataDef: EventMetadataDefinition,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
29
|
+
filter: PublicEventFilter,
|
|
30
|
+
): Promise<GetPublicEventsResult<T>> {
|
|
31
|
+
const { logs, maxLogsHit } = await node.getPublicLogs({
|
|
32
|
+
fromBlock: filter.fromBlock ? Number(filter.fromBlock) : undefined,
|
|
33
|
+
toBlock: filter.toBlock ? Number(filter.toBlock) : undefined,
|
|
34
|
+
txHash: filter.txHash,
|
|
35
|
+
contractAddress: filter.contractAddress,
|
|
36
|
+
afterLog: filter.afterLog,
|
|
21
37
|
});
|
|
22
38
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
const events: PublicEvent<T>[] = [];
|
|
40
|
+
|
|
41
|
+
for (const log of logs) {
|
|
42
|
+
const logFields = log.log.getEmittedFields();
|
|
43
|
+
// Event selector is at the last position of the emitted fields
|
|
44
|
+
const logEventSelector = EventSelector.fromField(logFields[logFields.length - 1]);
|
|
45
|
+
|
|
46
|
+
if (!logEventSelector.equals(eventMetadataDef.eventSelector)) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
events.push({
|
|
51
|
+
event: decodeFromAbi([eventMetadataDef.abiType], log.log.fields) as T,
|
|
52
|
+
metadata: {
|
|
53
|
+
l2BlockNumber: log.id.blockNumber,
|
|
54
|
+
l2BlockHash: log.id.blockHash,
|
|
55
|
+
txHash: log.id.txHash,
|
|
56
|
+
contractAddress: log.log.contractAddress,
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return { events, maxLogsHit };
|
|
44
62
|
}
|
package/src/api/fields.ts
CHANGED
package/src/api/keys.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { type PublicKey, PublicKeys } from '@aztec/stdlib/keys';
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
computeAppNullifierHidingKey,
|
|
4
4
|
deriveKeys,
|
|
5
5
|
deriveMasterIncomingViewingSecretKey,
|
|
6
|
-
|
|
6
|
+
deriveMasterNullifierHidingKey,
|
|
7
7
|
} from '@aztec/stdlib/keys';
|
|
8
8
|
export { generatePublicKey } from '../utils/pub_key.js';
|
package/src/api/wallet.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export {
|
|
2
2
|
type Aliased,
|
|
3
3
|
type SimulateOptions,
|
|
4
|
+
type ExecuteUtilityOptions,
|
|
4
5
|
type ProfileOptions,
|
|
5
6
|
type SendOptions,
|
|
6
7
|
type BatchableMethods,
|
|
@@ -11,9 +12,12 @@ export {
|
|
|
11
12
|
type Wallet,
|
|
12
13
|
type PrivateEvent,
|
|
13
14
|
type PrivateEventFilter,
|
|
15
|
+
type PublicEvent,
|
|
16
|
+
type PublicEventFilter,
|
|
14
17
|
type ContractMetadata,
|
|
15
18
|
type ContractClassMetadata,
|
|
16
|
-
|
|
19
|
+
AppCapabilitiesSchema,
|
|
20
|
+
WalletCapabilitiesSchema,
|
|
17
21
|
ExecutionPayloadSchema,
|
|
18
22
|
GasSettingsOptionSchema,
|
|
19
23
|
WalletSimulationFeeOptionSchema,
|
|
@@ -26,11 +30,49 @@ export {
|
|
|
26
30
|
EventMetadataDefinitionSchema,
|
|
27
31
|
PrivateEventSchema,
|
|
28
32
|
PrivateEventFilterSchema,
|
|
33
|
+
PublicEventSchema,
|
|
34
|
+
PublicEventFilterSchema,
|
|
29
35
|
ContractClassMetadataSchema,
|
|
30
36
|
ContractMetadataSchema,
|
|
31
37
|
WalletSchema,
|
|
38
|
+
ContractFunctionPatternSchema,
|
|
39
|
+
AccountsCapabilitySchema,
|
|
40
|
+
GrantedAccountsCapabilitySchema,
|
|
41
|
+
ContractsCapabilitySchema,
|
|
42
|
+
GrantedContractsCapabilitySchema,
|
|
43
|
+
ContractClassesCapabilitySchema,
|
|
44
|
+
GrantedContractClassesCapabilitySchema,
|
|
45
|
+
SimulationCapabilitySchema,
|
|
46
|
+
GrantedSimulationCapabilitySchema,
|
|
47
|
+
TransactionCapabilitySchema,
|
|
48
|
+
GrantedTransactionCapabilitySchema,
|
|
49
|
+
DataCapabilitySchema,
|
|
50
|
+
GrantedDataCapabilitySchema,
|
|
51
|
+
CapabilitySchema,
|
|
52
|
+
GrantedCapabilitySchema,
|
|
32
53
|
} from '../wallet/wallet.js';
|
|
33
54
|
|
|
55
|
+
export {
|
|
56
|
+
type AppCapabilities,
|
|
57
|
+
type WalletCapabilities,
|
|
58
|
+
CAPABILITY_VERSION,
|
|
59
|
+
type Capability,
|
|
60
|
+
type GrantedCapability,
|
|
61
|
+
type ContractFunctionPattern,
|
|
62
|
+
type AccountsCapability,
|
|
63
|
+
type GrantedAccountsCapability,
|
|
64
|
+
type ContractsCapability,
|
|
65
|
+
type GrantedContractsCapability,
|
|
66
|
+
type ContractClassesCapability,
|
|
67
|
+
type GrantedContractClassesCapability,
|
|
68
|
+
type SimulationCapability,
|
|
69
|
+
type GrantedSimulationCapability,
|
|
70
|
+
type TransactionCapability,
|
|
71
|
+
type GrantedTransactionCapability,
|
|
72
|
+
type DataCapability,
|
|
73
|
+
type GrantedDataCapability,
|
|
74
|
+
} from '../wallet/capabilities.js';
|
|
75
|
+
|
|
34
76
|
export { AccountManager } from '../wallet/account_manager.js';
|
|
35
77
|
|
|
36
78
|
export { type DeployAccountOptions, DeployAccountMethod } from '../wallet/deploy_account_method.js';
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
type SendInteractionOptions,
|
|
10
10
|
type SendInteractionOptionsWithoutWait,
|
|
11
11
|
type SendReturn,
|
|
12
|
+
type TxSendResultMined,
|
|
12
13
|
toSendOptions,
|
|
13
14
|
} from './interaction_options.js';
|
|
14
15
|
|
|
@@ -41,8 +42,8 @@ export abstract class BaseContractInteraction {
|
|
|
41
42
|
* the AztecAddress of the sender, optional fee configuration, and optional wait settings
|
|
42
43
|
* @returns TReturn (if wait is undefined/WaitOpts) or TxHash (if wait is NO_WAIT)
|
|
43
44
|
*/
|
|
44
|
-
// Overload for when wait is not specified at all - returns TReturn
|
|
45
|
-
public send<TReturn = TxReceipt>(options: SendInteractionOptionsWithoutWait): Promise<TReturn
|
|
45
|
+
// Overload for when wait is not specified at all - returns { receipt: TReturn, offchainEffects }
|
|
46
|
+
public send<TReturn = TxReceipt>(options: SendInteractionOptionsWithoutWait): Promise<TxSendResultMined<TReturn>>;
|
|
46
47
|
// Generic overload for explicit wait values
|
|
47
48
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
48
49
|
public send<TReturn = TxReceipt, W extends InteractionWaitOptions = undefined>(
|