@aztec/aztec.js 0.0.1-commit.d431d1c → 0.0.1-commit.e310a4c8
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/block.d.ts +2 -2
- package/dest/api/block.d.ts.map +1 -1
- package/dest/api/block.js +1 -1
- package/dest/api/contract.d.ts +16 -10
- package/dest/api/contract.d.ts.map +1 -1
- package/dest/api/contract.js +14 -8
- package/dest/api/keys.d.ts +1 -1
- package/dest/api/keys.js +1 -1
- package/dest/api/node.d.ts +8 -4
- package/dest/api/node.d.ts.map +1 -1
- package/dest/api/node.js +7 -3
- 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/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 +8 -10
- package/dest/contract/base_contract_interaction.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.js +5 -17
- package/dest/contract/deploy_method.d.ts +63 -16
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +36 -19
- package/dest/contract/interaction_options.d.ts +42 -5
- package/dest/contract/interaction_options.d.ts.map +1 -1
- package/dest/contract/interaction_options.js +8 -1
- package/dest/contract/protocol_contracts/auth-registry.d.ts +1 -10
- package/dest/contract/protocol_contracts/auth-registry.d.ts.map +1 -1
- package/dest/contract/protocol_contracts/auth-registry.js +61 -479
- package/dest/contract/protocol_contracts/contract-class-registry.d.ts +2 -11
- package/dest/contract/protocol_contracts/contract-class-registry.d.ts.map +1 -1
- package/dest/contract/protocol_contracts/contract-class-registry.js +10 -422
- 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 +80 -486
- 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 +0 -414
- package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts +3 -3
- package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts.map +1 -1
- package/dest/contract/protocol_contracts/multi-call-entrypoint.js +13 -14
- package/dest/contract/protocol_contracts/public-checks.d.ts +3 -3
- package/dest/contract/protocol_contracts/public-checks.d.ts.map +1 -1
- package/dest/contract/protocol_contracts/public-checks.js +13 -22
- package/dest/contract/wait_for_proven.js +1 -1
- package/dest/contract/wait_opts.d.ts +16 -0
- package/dest/contract/wait_opts.d.ts.map +1 -0
- package/dest/contract/wait_opts.js +5 -0
- package/dest/utils/authwit.d.ts +6 -6
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +2 -6
- package/dest/utils/node.d.ts +12 -1
- package/dest/utils/node.d.ts.map +1 -1
- package/dest/utils/node.js +46 -0
- package/dest/wallet/capabilities.d.ts +444 -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 +19 -5
- package/dest/wallet/deploy_account_method.d.ts.map +1 -1
- 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 +1356 -18
- package/dest/wallet/wallet.d.ts.map +1 -1
- package/dest/wallet/wallet.js +136 -4
- package/package.json +9 -9
- package/src/api/block.ts +1 -1
- package/src/api/contract.ts +22 -7
- package/src/api/keys.ts +2 -2
- package/src/api/node.ts +7 -3
- package/src/api/tx.ts +2 -0
- package/src/api/wallet.ts +43 -0
- package/src/contract/base_contract_interaction.ts +27 -15
- package/src/contract/deploy_method.ts +115 -23
- package/src/contract/interaction_options.ts +49 -4
- package/src/contract/protocol_contracts/auth-registry.ts +37 -240
- package/src/contract/protocol_contracts/contract-class-registry.ts +3 -204
- package/src/contract/protocol_contracts/contract-instance-registry.ts +34 -234
- package/src/contract/protocol_contracts/fee-juice.ts +0 -202
- package/src/contract/protocol_contracts/multi-call-entrypoint.ts +6 -12
- package/src/contract/protocol_contracts/public-checks.ts +6 -14
- package/src/contract/wait_for_proven.ts +1 -1
- package/src/contract/wait_opts.ts +21 -0
- package/src/utils/authwit.ts +16 -4
- package/src/utils/node.ts +62 -0
- package/src/wallet/capabilities.ts +491 -0
- package/src/wallet/deploy_account_method.ts +19 -4
- package/src/wallet/index.ts +1 -0
- package/src/wallet/wallet.ts +148 -12
- package/dest/contract/deploy_sent_tx.d.ts +0 -48
- package/dest/contract/deploy_sent_tx.d.ts.map +0 -1
- package/dest/contract/deploy_sent_tx.js +0 -46
- package/dest/contract/sent_tx.d.ts +0 -50
- package/dest/contract/sent_tx.d.ts.map +0 -1
- package/dest/contract/sent_tx.js +0 -90
- package/src/contract/deploy_sent_tx.ts +0 -75
- package/src/contract/sent_tx.ts +0 -129
|
@@ -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,EAGL,KAAK,gBAAgB,EAErB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,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,EAAoB,KA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HANGED
|
@@ -6,6 +6,7 @@ import { Gas } from '@aztec/stdlib/gas';
|
|
|
6
6
|
import { AbiDecodedSchema, optional, schemas, zodFor } from '@aztec/stdlib/schemas';
|
|
7
7
|
import { Capsule, HashedValues, TxHash, TxProfileResult, TxReceipt, TxSimulationResult, UtilitySimulationResult, inTxSchema } from '@aztec/stdlib/tx';
|
|
8
8
|
import { z } from 'zod';
|
|
9
|
+
import { NO_WAIT } from '../contract/interaction_options.js';
|
|
9
10
|
export const FunctionCallSchema = z.object({
|
|
10
11
|
name: z.string(),
|
|
11
12
|
to: schemas.AztecAddress,
|
|
@@ -41,11 +42,21 @@ export const WalletSimulationFeeOptionSchema = GasSettingsOptionSchema.extend({
|
|
|
41
42
|
estimatedGasPadding: optional(z.number()),
|
|
42
43
|
estimateGas: optional(z.boolean())
|
|
43
44
|
});
|
|
45
|
+
export const WaitOptsSchema = z.object({
|
|
46
|
+
ignoreDroppedReceiptsFor: optional(z.number()),
|
|
47
|
+
timeout: optional(z.number()),
|
|
48
|
+
interval: optional(z.number()),
|
|
49
|
+
dontThrowOnRevert: optional(z.boolean())
|
|
50
|
+
});
|
|
44
51
|
export const SendOptionsSchema = z.object({
|
|
45
52
|
from: schemas.AztecAddress,
|
|
46
53
|
authWitnesses: optional(z.array(AuthWitness.schema)),
|
|
47
54
|
capsules: optional(z.array(Capsule.schema)),
|
|
48
|
-
fee: optional(GasSettingsOptionSchema)
|
|
55
|
+
fee: optional(GasSettingsOptionSchema),
|
|
56
|
+
wait: optional(z.union([
|
|
57
|
+
z.literal(NO_WAIT),
|
|
58
|
+
WaitOptsSchema
|
|
59
|
+
]))
|
|
49
60
|
});
|
|
50
61
|
export const SimulateOptionsSchema = z.object({
|
|
51
62
|
from: schemas.AztecAddress,
|
|
@@ -101,6 +112,124 @@ export const ContractClassMetadataSchema = z.object({
|
|
|
101
112
|
isArtifactRegistered: z.boolean(),
|
|
102
113
|
isContractClassPubliclyRegistered: z.boolean()
|
|
103
114
|
});
|
|
115
|
+
export const ContractFunctionPatternSchema = z.object({
|
|
116
|
+
contract: z.union([
|
|
117
|
+
schemas.AztecAddress,
|
|
118
|
+
z.literal('*')
|
|
119
|
+
]),
|
|
120
|
+
function: z.union([
|
|
121
|
+
z.string(),
|
|
122
|
+
z.literal('*')
|
|
123
|
+
])
|
|
124
|
+
});
|
|
125
|
+
export const AccountsCapabilitySchema = z.object({
|
|
126
|
+
type: z.literal('accounts'),
|
|
127
|
+
canGet: optional(z.boolean()),
|
|
128
|
+
canCreateAuthWit: optional(z.boolean())
|
|
129
|
+
});
|
|
130
|
+
export const GrantedAccountsCapabilitySchema = AccountsCapabilitySchema.extend({
|
|
131
|
+
accounts: z.array(z.object({
|
|
132
|
+
alias: z.string(),
|
|
133
|
+
item: schemas.AztecAddress
|
|
134
|
+
}))
|
|
135
|
+
});
|
|
136
|
+
export const ContractsCapabilitySchema = z.object({
|
|
137
|
+
type: z.literal('contracts'),
|
|
138
|
+
contracts: z.union([
|
|
139
|
+
z.literal('*'),
|
|
140
|
+
z.array(schemas.AztecAddress)
|
|
141
|
+
]),
|
|
142
|
+
canRegister: optional(z.boolean()),
|
|
143
|
+
canGetMetadata: optional(z.boolean())
|
|
144
|
+
});
|
|
145
|
+
export const GrantedContractsCapabilitySchema = ContractsCapabilitySchema;
|
|
146
|
+
export const ContractClassesCapabilitySchema = z.object({
|
|
147
|
+
type: z.literal('contractClasses'),
|
|
148
|
+
classes: z.union([
|
|
149
|
+
z.literal('*'),
|
|
150
|
+
z.array(schemas.Fr)
|
|
151
|
+
]),
|
|
152
|
+
canGetMetadata: z.boolean()
|
|
153
|
+
});
|
|
154
|
+
export const GrantedContractClassesCapabilitySchema = ContractClassesCapabilitySchema;
|
|
155
|
+
export const SimulationCapabilitySchema = z.object({
|
|
156
|
+
type: z.literal('simulation'),
|
|
157
|
+
transactions: optional(z.object({
|
|
158
|
+
scope: z.union([
|
|
159
|
+
z.literal('*'),
|
|
160
|
+
z.array(ContractFunctionPatternSchema)
|
|
161
|
+
])
|
|
162
|
+
})),
|
|
163
|
+
utilities: optional(z.object({
|
|
164
|
+
scope: z.union([
|
|
165
|
+
z.literal('*'),
|
|
166
|
+
z.array(ContractFunctionPatternSchema)
|
|
167
|
+
])
|
|
168
|
+
}))
|
|
169
|
+
});
|
|
170
|
+
export const GrantedSimulationCapabilitySchema = SimulationCapabilitySchema;
|
|
171
|
+
export const TransactionCapabilitySchema = z.object({
|
|
172
|
+
type: z.literal('transaction'),
|
|
173
|
+
scope: z.union([
|
|
174
|
+
z.literal('*'),
|
|
175
|
+
z.array(ContractFunctionPatternSchema)
|
|
176
|
+
])
|
|
177
|
+
});
|
|
178
|
+
export const GrantedTransactionCapabilitySchema = TransactionCapabilitySchema;
|
|
179
|
+
export const DataCapabilitySchema = z.object({
|
|
180
|
+
type: z.literal('data'),
|
|
181
|
+
addressBook: optional(z.boolean()),
|
|
182
|
+
privateEvents: optional(z.object({
|
|
183
|
+
contracts: z.union([
|
|
184
|
+
z.literal('*'),
|
|
185
|
+
z.array(schemas.AztecAddress)
|
|
186
|
+
])
|
|
187
|
+
}))
|
|
188
|
+
});
|
|
189
|
+
export const GrantedDataCapabilitySchema = DataCapabilitySchema;
|
|
190
|
+
export const CapabilitySchema = z.discriminatedUnion('type', [
|
|
191
|
+
AccountsCapabilitySchema,
|
|
192
|
+
ContractsCapabilitySchema,
|
|
193
|
+
ContractClassesCapabilitySchema,
|
|
194
|
+
SimulationCapabilitySchema,
|
|
195
|
+
TransactionCapabilitySchema,
|
|
196
|
+
DataCapabilitySchema
|
|
197
|
+
]);
|
|
198
|
+
export const GrantedCapabilitySchema = z.discriminatedUnion('type', [
|
|
199
|
+
GrantedAccountsCapabilitySchema,
|
|
200
|
+
GrantedContractsCapabilitySchema,
|
|
201
|
+
GrantedContractClassesCapabilitySchema,
|
|
202
|
+
GrantedSimulationCapabilitySchema,
|
|
203
|
+
GrantedTransactionCapabilitySchema,
|
|
204
|
+
GrantedDataCapabilitySchema
|
|
205
|
+
]);
|
|
206
|
+
export const AppCapabilitiesSchema = z.object({
|
|
207
|
+
version: z.literal('1.0'),
|
|
208
|
+
metadata: z.object({
|
|
209
|
+
name: z.string(),
|
|
210
|
+
version: z.string(),
|
|
211
|
+
description: optional(z.string()),
|
|
212
|
+
url: optional(z.string()),
|
|
213
|
+
icon: optional(z.string())
|
|
214
|
+
}),
|
|
215
|
+
capabilities: z.array(CapabilitySchema),
|
|
216
|
+
behavior: optional(z.object({
|
|
217
|
+
mode: optional(z.enum([
|
|
218
|
+
'strict',
|
|
219
|
+
'permissive'
|
|
220
|
+
])),
|
|
221
|
+
expiration: optional(z.number())
|
|
222
|
+
}))
|
|
223
|
+
});
|
|
224
|
+
export const WalletCapabilitiesSchema = z.object({
|
|
225
|
+
version: z.literal('1.0'),
|
|
226
|
+
granted: z.array(GrantedCapabilitySchema),
|
|
227
|
+
wallet: z.object({
|
|
228
|
+
name: z.string(),
|
|
229
|
+
version: z.string()
|
|
230
|
+
}),
|
|
231
|
+
expiresAt: optional(z.number())
|
|
232
|
+
});
|
|
104
233
|
/**
|
|
105
234
|
* Record of all wallet method schemas (excluding batch).
|
|
106
235
|
* This is the single source of truth for method schemas - batch schemas are derived from this.
|
|
@@ -109,7 +238,6 @@ export const ContractClassMetadataSchema = z.object({
|
|
|
109
238
|
chainId: schemas.Fr,
|
|
110
239
|
version: schemas.Fr
|
|
111
240
|
})),
|
|
112
|
-
getTxReceipt: z.function().args(TxHash.schema).returns(TxReceipt.schema),
|
|
113
241
|
getContractMetadata: z.function().args(schemas.AztecAddress).returns(ContractMetadataSchema),
|
|
114
242
|
getContractClassMetadata: z.function().args(schemas.Fr).returns(ContractClassMetadataSchema),
|
|
115
243
|
getPrivateEvents: z.function().args(EventMetadataDefinitionSchema, PrivateEventFilterSchema).returns(z.array(PrivateEventSchema)),
|
|
@@ -126,8 +254,12 @@ export const ContractClassMetadataSchema = z.object({
|
|
|
126
254
|
simulateTx: z.function().args(ExecutionPayloadSchema, SimulateOptionsSchema).returns(TxSimulationResult.schema),
|
|
127
255
|
simulateUtility: z.function().args(FunctionCallSchema, optional(z.array(AuthWitness.schema))).returns(UtilitySimulationResult.schema),
|
|
128
256
|
profileTx: z.function().args(ExecutionPayloadSchema, ProfileOptionsSchema).returns(TxProfileResult.schema),
|
|
129
|
-
sendTx: z.function().args(ExecutionPayloadSchema, SendOptionsSchema).returns(
|
|
130
|
-
|
|
257
|
+
sendTx: z.function().args(ExecutionPayloadSchema, SendOptionsSchema).returns(z.union([
|
|
258
|
+
TxHash.schema,
|
|
259
|
+
TxReceipt.schema
|
|
260
|
+
])),
|
|
261
|
+
createAuthWit: z.function().args(schemas.AztecAddress, MessageHashOrIntentSchema).returns(AuthWitness.schema),
|
|
262
|
+
requestCapabilities: z.function().args(AppCapabilitiesSchema).returns(WalletCapabilitiesSchema)
|
|
131
263
|
};
|
|
132
264
|
/**
|
|
133
265
|
* 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.e310a4c8",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./abi": "./dest/api/abi.js",
|
|
@@ -85,20 +85,20 @@
|
|
|
85
85
|
]
|
|
86
86
|
},
|
|
87
87
|
"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.
|
|
88
|
+
"@aztec/constants": "0.0.1-commit.e310a4c8",
|
|
89
|
+
"@aztec/entrypoints": "0.0.1-commit.e310a4c8",
|
|
90
|
+
"@aztec/ethereum": "0.0.1-commit.e310a4c8",
|
|
91
|
+
"@aztec/foundation": "0.0.1-commit.e310a4c8",
|
|
92
|
+
"@aztec/l1-artifacts": "0.0.1-commit.e310a4c8",
|
|
93
|
+
"@aztec/protocol-contracts": "0.0.1-commit.e310a4c8",
|
|
94
|
+
"@aztec/stdlib": "0.0.1-commit.e310a4c8",
|
|
95
95
|
"axios": "^1.12.0",
|
|
96
96
|
"tslib": "^2.4.0",
|
|
97
97
|
"viem": "npm:@aztec/viem@2.38.2",
|
|
98
98
|
"zod": "^3.23.8"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
|
-
"@aztec/builder": "0.0.1-commit.
|
|
101
|
+
"@aztec/builder": "0.0.1-commit.e310a4c8",
|
|
102
102
|
"@jest/globals": "^30.0.0",
|
|
103
103
|
"@types/jest": "^30.0.0",
|
|
104
104
|
"@types/node": "^22.15.17",
|
package/src/api/block.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Body,
|
|
1
|
+
export { Body, L2Block } from '@aztec/stdlib/block';
|
|
2
2
|
export { getTimestampRangeForEpoch } from '@aztec/stdlib/epoch-helpers';
|
package/src/api/contract.ts
CHANGED
|
@@ -10,13 +10,21 @@
|
|
|
10
10
|
* or can be queried via `simulate()`.
|
|
11
11
|
*
|
|
12
12
|
* ```ts
|
|
13
|
-
*
|
|
13
|
+
* // Deploy and get the contract instance directly (default behavior)
|
|
14
|
+
* const contract = await Contract.deploy(wallet, MyContractArtifact, [...constructorArgs]).send({ from: accountAddress });
|
|
14
15
|
* console.log(`Contract deployed at ${contract.address}`);
|
|
16
|
+
*
|
|
17
|
+
* // Or get the full receipt with contract and instance
|
|
18
|
+
* const receipt = await Contract.deploy(wallet, MyContractArtifact, [...constructorArgs]).send({
|
|
19
|
+
* from: accountAddress,
|
|
20
|
+
* wait: { returnReceipt: true }
|
|
21
|
+
* });
|
|
22
|
+
* console.log(`Contract deployed at ${receipt.contract.address}`);
|
|
15
23
|
* ```
|
|
16
24
|
*
|
|
17
25
|
* ```ts
|
|
18
26
|
* const contract = Contract.at(address, MyContractArtifact, wallet);
|
|
19
|
-
* await contract.methods.mint(1000, owner).send()
|
|
27
|
+
* await contract.methods.mint(1000, owner).send({ from: accountAddress });
|
|
20
28
|
* console.log(`Total supply is now ${await contract.methods.totalSupply().simulate()}`);
|
|
21
29
|
* ```
|
|
22
30
|
*
|
|
@@ -25,9 +33,8 @@
|
|
|
25
33
|
* a transaction to the network via the `send` method, but you can also `simulate` it without sending,
|
|
26
34
|
* or obtaining the `request` for aggregating into a {@link BatchCall}.
|
|
27
35
|
*
|
|
28
|
-
* The
|
|
29
|
-
*
|
|
30
|
-
* has synchronized its changes.
|
|
36
|
+
* The `send` method returns a {@link TxReceipt} by default (waits for the transaction to be mined).
|
|
37
|
+
* If you pass `wait: NO_WAIT` in the options, it will return a {@link TxHash} immediately without waiting.
|
|
31
38
|
*
|
|
32
39
|
* @remarks If you are using typescript, consider using the
|
|
33
40
|
* {@link https://docs.aztec.network/developers/aztec-nr/how_to_compile_contract#use-generated-interfaces | autogenerated type-safe interfaces}
|
|
@@ -39,27 +46,35 @@ export { Contract } from '../contract/contract.js';
|
|
|
39
46
|
export { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
40
47
|
|
|
41
48
|
export {
|
|
49
|
+
NO_WAIT,
|
|
50
|
+
type NoWait,
|
|
42
51
|
type RequestInteractionOptions,
|
|
43
52
|
type SendInteractionOptions,
|
|
44
53
|
type ProfileInteractionOptions,
|
|
45
54
|
type SimulateInteractionOptions,
|
|
46
55
|
type InteractionFeeOptions,
|
|
56
|
+
type InteractionWaitOptions,
|
|
47
57
|
type GasSettingsOption,
|
|
58
|
+
type SendReturn,
|
|
59
|
+
type SimulationReturn,
|
|
48
60
|
toProfileOptions,
|
|
49
61
|
toSendOptions,
|
|
50
62
|
toSimulateOptions,
|
|
51
63
|
} from '../contract/interaction_options.js';
|
|
52
64
|
|
|
53
|
-
export { DefaultWaitOpts,
|
|
65
|
+
export { DefaultWaitOpts, type WaitOpts } from '../contract/wait_opts.js';
|
|
54
66
|
export { ContractBase, type ContractMethod, type ContractStorageLayout } from '../contract/contract_base.js';
|
|
55
67
|
export { BatchCall } from '../contract/batch_call.js';
|
|
56
68
|
export {
|
|
57
69
|
type DeployOptions,
|
|
70
|
+
type DeployReturn,
|
|
71
|
+
type DeployTxReceipt,
|
|
72
|
+
type DeployWaitOptions,
|
|
73
|
+
type DeployInteractionWaitOptions,
|
|
58
74
|
DeployMethod,
|
|
59
75
|
type RequestDeployOptions,
|
|
60
76
|
type SimulateDeployOptions,
|
|
61
77
|
} from '../contract/deploy_method.js';
|
|
62
|
-
export { DeploySentTx } from '../contract/deploy_sent_tx.js';
|
|
63
78
|
export { waitForProven, type WaitForProvenOpts, DefaultWaitForProvenOpts } from '../contract/wait_for_proven.js';
|
|
64
79
|
export { getGasLimits } from '../contract/get_gas_limits.js';
|
|
65
80
|
|
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/node.ts
CHANGED
|
@@ -3,18 +3,22 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The primary function is {@link createAztecNodeClient}, which creates a JSON-RPC client
|
|
5
5
|
* that connects to a running Aztec node instance. Use {@link waitForNode} to wait for
|
|
6
|
-
* the node to be ready before proceeding
|
|
6
|
+
* the node to be ready before proceeding, and {@link waitForTx} to wait for a transaction
|
|
7
|
+
* to be mined.
|
|
7
8
|
*
|
|
8
9
|
* @example
|
|
9
10
|
* ```ts
|
|
10
|
-
* import { createAztecNodeClient, waitForNode } from '@aztec/aztec.js/node';
|
|
11
|
+
* import { createAztecNodeClient, waitForNode, waitForTx } from '@aztec/aztec.js/node';
|
|
11
12
|
*
|
|
12
13
|
* const node = createAztecNodeClient('http://localhost:8080');
|
|
13
14
|
* await waitForNode(node);
|
|
14
15
|
* const blockNumber = await node.getBlockNumber();
|
|
16
|
+
*
|
|
17
|
+
* // Wait for a transaction
|
|
18
|
+
* const receipt = await waitForTx(node, txHash);
|
|
15
19
|
* ```
|
|
16
20
|
*
|
|
17
21
|
* @packageDocumentation
|
|
18
22
|
*/
|
|
19
|
-
export { createAztecNodeClient, waitForNode, type AztecNode } from '../utils/node.js';
|
|
23
|
+
export { createAztecNodeClient, waitForNode, waitForTx, type AztecNode } from '../utils/node.js';
|
|
20
24
|
export { type NodeInfo } from '@aztec/stdlib/contract';
|
package/src/api/tx.ts
CHANGED
package/src/api/wallet.ts
CHANGED
|
@@ -11,10 +11,15 @@ export {
|
|
|
11
11
|
type Wallet,
|
|
12
12
|
type PrivateEvent,
|
|
13
13
|
type PrivateEventFilter,
|
|
14
|
+
type ContractMetadata,
|
|
15
|
+
type ContractClassMetadata,
|
|
16
|
+
AppCapabilitiesSchema,
|
|
17
|
+
WalletCapabilitiesSchema,
|
|
14
18
|
FunctionCallSchema,
|
|
15
19
|
ExecutionPayloadSchema,
|
|
16
20
|
GasSettingsOptionSchema,
|
|
17
21
|
WalletSimulationFeeOptionSchema,
|
|
22
|
+
WaitOptsSchema,
|
|
18
23
|
SendOptionsSchema,
|
|
19
24
|
SimulateOptionsSchema,
|
|
20
25
|
ProfileOptionsSchema,
|
|
@@ -23,9 +28,47 @@ export {
|
|
|
23
28
|
EventMetadataDefinitionSchema,
|
|
24
29
|
PrivateEventSchema,
|
|
25
30
|
PrivateEventFilterSchema,
|
|
31
|
+
ContractClassMetadataSchema,
|
|
32
|
+
ContractMetadataSchema,
|
|
26
33
|
WalletSchema,
|
|
34
|
+
ContractFunctionPatternSchema,
|
|
35
|
+
AccountsCapabilitySchema,
|
|
36
|
+
GrantedAccountsCapabilitySchema,
|
|
37
|
+
ContractsCapabilitySchema,
|
|
38
|
+
GrantedContractsCapabilitySchema,
|
|
39
|
+
ContractClassesCapabilitySchema,
|
|
40
|
+
GrantedContractClassesCapabilitySchema,
|
|
41
|
+
SimulationCapabilitySchema,
|
|
42
|
+
GrantedSimulationCapabilitySchema,
|
|
43
|
+
TransactionCapabilitySchema,
|
|
44
|
+
GrantedTransactionCapabilitySchema,
|
|
45
|
+
DataCapabilitySchema,
|
|
46
|
+
GrantedDataCapabilitySchema,
|
|
47
|
+
CapabilitySchema,
|
|
48
|
+
GrantedCapabilitySchema,
|
|
27
49
|
} from '../wallet/wallet.js';
|
|
28
50
|
|
|
51
|
+
export {
|
|
52
|
+
type AppCapabilities,
|
|
53
|
+
type WalletCapabilities,
|
|
54
|
+
CAPABILITY_VERSION,
|
|
55
|
+
type Capability,
|
|
56
|
+
type GrantedCapability,
|
|
57
|
+
type ContractFunctionPattern,
|
|
58
|
+
type AccountsCapability,
|
|
59
|
+
type GrantedAccountsCapability,
|
|
60
|
+
type ContractsCapability,
|
|
61
|
+
type GrantedContractsCapability,
|
|
62
|
+
type ContractClassesCapability,
|
|
63
|
+
type GrantedContractClassesCapability,
|
|
64
|
+
type SimulationCapability,
|
|
65
|
+
type GrantedSimulationCapability,
|
|
66
|
+
type TransactionCapability,
|
|
67
|
+
type GrantedTransactionCapability,
|
|
68
|
+
type DataCapability,
|
|
69
|
+
type GrantedDataCapability,
|
|
70
|
+
} from '../wallet/capabilities.js';
|
|
71
|
+
|
|
29
72
|
export { AccountManager } from '../wallet/account_manager.js';
|
|
30
73
|
|
|
31
74
|
export { type DeployAccountOptions, DeployAccountMethod } from '../wallet/deploy_account_method.js';
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { createLogger } from '@aztec/foundation/log';
|
|
2
2
|
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
3
|
-
import type { Capsule, ExecutionPayload } from '@aztec/stdlib/tx';
|
|
3
|
+
import type { Capsule, ExecutionPayload, TxReceipt } from '@aztec/stdlib/tx';
|
|
4
4
|
|
|
5
5
|
import type { Wallet } from '../wallet/wallet.js';
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import {
|
|
7
|
+
type InteractionWaitOptions,
|
|
8
|
+
type RequestInteractionOptions,
|
|
9
|
+
type SendInteractionOptions,
|
|
10
|
+
type SendInteractionOptionsWithoutWait,
|
|
11
|
+
type SendReturn,
|
|
12
|
+
toSendOptions,
|
|
13
|
+
} from './interaction_options.js';
|
|
8
14
|
|
|
9
15
|
/**
|
|
10
16
|
* Base class for an interaction with a contract, be it a deployment, a function call, or a batch.
|
|
@@ -30,20 +36,26 @@ export abstract class BaseContractInteraction {
|
|
|
30
36
|
// docs:start:send
|
|
31
37
|
/**
|
|
32
38
|
* Sends a transaction to the contract function with the specified options.
|
|
33
|
-
*
|
|
34
|
-
* It creates and signs the transaction if necessary, and returns a SentTx instance,
|
|
35
|
-
* which can be used to track the transaction status, receipt, and events.
|
|
39
|
+
* By default, waits for the transaction to be mined and returns the receipt (or custom type).
|
|
36
40
|
* @param options - An object containing 'from' property representing
|
|
37
|
-
* the AztecAddress of the sender and optional
|
|
38
|
-
* @returns
|
|
41
|
+
* the AztecAddress of the sender, optional fee configuration, and optional wait settings
|
|
42
|
+
* @returns TReturn (if wait is undefined/WaitOpts) or TxHash (if wait is NO_WAIT)
|
|
39
43
|
*/
|
|
40
|
-
|
|
44
|
+
// Overload for when wait is not specified at all - returns TReturn
|
|
45
|
+
public send<TReturn = TxReceipt>(options: SendInteractionOptionsWithoutWait): Promise<TReturn>;
|
|
46
|
+
// Generic overload for explicit wait values
|
|
47
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
48
|
+
public send<TReturn = TxReceipt, W extends InteractionWaitOptions = undefined>(
|
|
49
|
+
options: SendInteractionOptions<W>,
|
|
50
|
+
): Promise<SendReturn<W, TReturn>>;
|
|
51
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
52
|
+
public async send<TReturn = TxReceipt>(
|
|
53
|
+
options: SendInteractionOptions<InteractionWaitOptions>,
|
|
54
|
+
): Promise<SendReturn<typeof options.wait, TReturn>> {
|
|
41
55
|
// docs:end:send
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
};
|
|
47
|
-
return new SentTx(this.wallet, sendTx);
|
|
56
|
+
const executionPayload = await this.request(options);
|
|
57
|
+
const sendOptions = toSendOptions(options);
|
|
58
|
+
|
|
59
|
+
return (await this.wallet.sendTx(executionPayload, sendOptions as any)) as SendReturn<typeof options.wait, TReturn>;
|
|
48
60
|
}
|
|
49
61
|
}
|