@azguardwallet/aztec-wallet 2.0.3 → 3.0.0-devnet.20251212
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 +17 -7
- package/dist/azguard.d.ts +23 -33
- package/dist/azguard.js +214 -228
- package/dist/methods.js +8 -20
- package/dist/schemas.d.ts +8 -226
- package/dist/schemas.js +6 -5
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ const wallet = await AztecWallet.connect(
|
|
|
30
30
|
logo: "...",
|
|
31
31
|
url: "..."
|
|
32
32
|
},
|
|
33
|
-
"
|
|
33
|
+
"devnet" // or "sandbox", or CAIP-string like "aztec:1654394782"
|
|
34
34
|
);
|
|
35
35
|
```
|
|
36
36
|
|
|
@@ -39,16 +39,24 @@ Then use this `wallet` for interaction with Aztec.js:
|
|
|
39
39
|
```js
|
|
40
40
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
41
41
|
import { SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee';
|
|
42
|
-
import {
|
|
42
|
+
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
43
|
+
import { TokenContract, TokenContractArtifact } from '@aztec/noir-contracts.js/Token';
|
|
43
44
|
|
|
44
|
-
const
|
|
45
|
+
const accounts = await wallet.getAccounts();
|
|
46
|
+
const address = accounts[0].item;
|
|
45
47
|
|
|
46
48
|
const tokenAddress = AztecAddress.fromString("0x...");
|
|
47
49
|
const tokenContract = await TokenContract.at(tokenAddress, wallet);
|
|
48
50
|
|
|
51
|
+
// register token contract in user's PXE
|
|
52
|
+
|
|
53
|
+
const node = createAztecNodeClient("https://next.devnet.aztec-labs.com");
|
|
54
|
+
const tokenInstance = await node.getContract(tokenAddress);
|
|
55
|
+
await wallet.registerContract(tokenInstance, TokenContractArtifact);
|
|
56
|
+
|
|
49
57
|
// get token private balance
|
|
50
58
|
|
|
51
|
-
const prvBalance = await
|
|
59
|
+
const prvBalance = await tokenContract.methods
|
|
52
60
|
.balance_of_private(address)
|
|
53
61
|
.simulate({from: address});
|
|
54
62
|
|
|
@@ -56,7 +64,7 @@ console.log("Private balance", prvBalance);
|
|
|
56
64
|
|
|
57
65
|
// get token public balance
|
|
58
66
|
|
|
59
|
-
const pubBalance = await
|
|
67
|
+
const pubBalance = await tokenContract.methods
|
|
60
68
|
.balance_of_public(address)
|
|
61
69
|
.simulate({from: address});
|
|
62
70
|
|
|
@@ -70,7 +78,7 @@ const feeOptions = {
|
|
|
70
78
|
),
|
|
71
79
|
};
|
|
72
80
|
|
|
73
|
-
const txReceipt = await
|
|
81
|
+
const txReceipt = await tokenContract.methods
|
|
74
82
|
.transfer(AztecAddress.fromString("0x..."), 100000000n)
|
|
75
83
|
.send({from: address, fee: feeOptions})
|
|
76
84
|
.wait();
|
|
@@ -87,7 +95,9 @@ When Azguard user confirms connection from a dapp (`AztecWallet.connect()`), a d
|
|
|
87
95
|
Even though the `AztecWallet` client reconnects automatically, you might want to additionally track the connection state. You can do the following:
|
|
88
96
|
|
|
89
97
|
```js
|
|
90
|
-
// connect the wallet
|
|
98
|
+
// connect the wallet
|
|
99
|
+
// (it's lazily called under the hood, so you don't have to call it manually,
|
|
100
|
+
// unless you want to connect immediately)
|
|
91
101
|
await wallet.connect();
|
|
92
102
|
|
|
93
103
|
// check if the wallet is connected
|
package/dist/azguard.d.ts
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import { CaipChain, DappMetadata } from "@azguardwallet/types";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { CallIntent, IntentInnerHash } from "@aztec/aztec.js/authorization";
|
|
3
|
+
import { Aliased, BatchableMethods, BatchedMethod, BatchResults, PrivateEvent, PrivateEventFilter, ProfileOptions, SendOptions, SimulateOptions, Wallet } from "@aztec/aztec.js/wallet";
|
|
4
|
+
import { ChainInfo } from "@aztec/entrypoints/interfaces";
|
|
5
|
+
import { Fr } from "@aztec/foundation/curves/bn254";
|
|
6
|
+
import { ContractArtifact, EventMetadataDefinition, FunctionCall } from "@aztec/stdlib/abi";
|
|
7
|
+
import { AztecAddress } from "@aztec/stdlib/aztec-address";
|
|
8
|
+
import { AuthWitness } from "@aztec/stdlib/auth-witness";
|
|
9
|
+
import { ContractClassMetadata, ContractInstanceWithAddress, ContractMetadata } from "@aztec/stdlib/contract";
|
|
10
|
+
import { ExecutionPayload, TxSimulationResult, UtilitySimulationResult, TxHash, TxReceipt, TxProfileResult } from "@aztec/stdlib/tx";
|
|
8
11
|
/** Azguard Wallet client fully compatible with Aztec.js' `Wallet` interface */
|
|
9
12
|
export declare class AztecWallet implements Wallet {
|
|
10
13
|
#private;
|
|
11
14
|
/**
|
|
12
15
|
* Creates `AztecWallet` instance, connected to Azguard Wallet
|
|
13
16
|
* @param dapp Dapp metadata (default: { name: window.location.hostname })
|
|
14
|
-
* @param chain Chain (default: "
|
|
17
|
+
* @param chain Chain (default: "devnet")
|
|
15
18
|
* @param timeout Timeout in ms for the `window.azguard` object lookup (default: 1000ms)
|
|
16
19
|
* @returns AztecWallet instance
|
|
17
20
|
*/
|
|
18
|
-
static connect(dapp?: DappMetadata, chain?: "
|
|
21
|
+
static connect(dapp?: DappMetadata, chain?: "devnet" | "sandbox" | CaipChain, timeout?: number): Promise<AztecWallet>;
|
|
19
22
|
/** Indicates whether the wallet is connected or not */
|
|
20
23
|
get connected(): boolean;
|
|
21
24
|
/** Event handlers invoked when the wallet is connected */
|
|
@@ -27,32 +30,19 @@ export declare class AztecWallet implements Wallet {
|
|
|
27
30
|
/** Disconnects from the wallet */
|
|
28
31
|
disconnect(): Promise<void>;
|
|
29
32
|
private constructor();
|
|
30
|
-
getCompleteAddress(): CompleteAddress;
|
|
31
|
-
getAddress(): AztecAddress;
|
|
32
|
-
getChainId(): Fr;
|
|
33
|
-
getVersion(): Fr;
|
|
34
|
-
createTxExecutionRequest(exec: ExecutionPayload, fee: FeeOptions, options: TxExecutionOptions): Promise<TxExecutionRequest>;
|
|
35
|
-
createAuthWit(messageHashOrIntent: IntentAction | IntentInnerHash | Fr | Buffer): Promise<AuthWitness>;
|
|
36
|
-
simulateTx(txRequest: TxExecutionRequest, simulatePublic: boolean, skipTxValidation?: boolean, skipFeeEnforcement?: boolean, overrides?: SimulationOverrides, scopes?: AztecAddress[]): Promise<TxSimulationResult>;
|
|
37
|
-
simulateUtility(functionName: string, args: any[], to: AztecAddress, authwits?: AuthWitness[], from?: AztecAddress, scopes?: AztecAddress[]): Promise<UtilitySimulationResult>;
|
|
38
|
-
profileTx(txRequest: TxExecutionRequest, profileMode: "gates" | "execution-steps" | "full", skipProofGeneration?: boolean, msgSender?: AztecAddress): Promise<TxProfileResult>;
|
|
39
|
-
sendTx(tx: Tx): Promise<TxHash>;
|
|
40
33
|
getContractClassMetadata(id: Fr, includeArtifact?: boolean): Promise<ContractClassMetadata>;
|
|
41
34
|
getContractMetadata(address: AztecAddress): Promise<ContractMetadata>;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
artifact?: ContractArtifact;
|
|
45
|
-
}): Promise<void>;
|
|
46
|
-
registerContractClass(artifact: ContractArtifact): Promise<void>;
|
|
47
|
-
proveTx(txRequest: TxExecutionRequest, privateExecutionResult?: PrivateExecutionResult): Promise<TxProvingResult>;
|
|
48
|
-
getNodeInfo(): Promise<NodeInfo>;
|
|
49
|
-
getPXEInfo(): Promise<PXEInfo>;
|
|
50
|
-
getCurrentBaseFees(): Promise<GasFees>;
|
|
51
|
-
updateContract(contractAddress: AztecAddress, artifact: ContractArtifact): Promise<void>;
|
|
52
|
-
registerSender(address: AztecAddress): Promise<AztecAddress>;
|
|
53
|
-
getSenders(): Promise<AztecAddress[]>;
|
|
54
|
-
removeSender(address: AztecAddress): Promise<void>;
|
|
35
|
+
getPrivateEvents<T>(eventMetadata: EventMetadataDefinition, eventFilter: PrivateEventFilter): Promise<PrivateEvent<T>[]>;
|
|
36
|
+
getChainInfo(): Promise<ChainInfo>;
|
|
55
37
|
getTxReceipt(txHash: TxHash): Promise<TxReceipt>;
|
|
56
|
-
|
|
57
|
-
|
|
38
|
+
registerSender(address: AztecAddress, alias?: string): Promise<AztecAddress>;
|
|
39
|
+
getAddressBook(): Promise<Aliased<AztecAddress>[]>;
|
|
40
|
+
getAccounts(): Promise<Aliased<AztecAddress>[]>;
|
|
41
|
+
registerContract(instance: ContractInstanceWithAddress, artifact?: ContractArtifact, secretKey?: Fr): Promise<ContractInstanceWithAddress>;
|
|
42
|
+
simulateTx(exec: ExecutionPayload, opts: SimulateOptions): Promise<TxSimulationResult>;
|
|
43
|
+
simulateUtility(call: FunctionCall, authwits?: AuthWitness[]): Promise<UtilitySimulationResult>;
|
|
44
|
+
profileTx(exec: ExecutionPayload, opts: ProfileOptions): Promise<TxProfileResult>;
|
|
45
|
+
sendTx(exec: ExecutionPayload, opts: SendOptions): Promise<TxHash>;
|
|
46
|
+
createAuthWit(from: AztecAddress, messageHashOrIntent: Fr | IntentInnerHash | CallIntent): Promise<AuthWitness>;
|
|
47
|
+
batch<const T extends readonly BatchedMethod<keyof BatchableMethods>[]>(methods: T): Promise<BatchResults<T>>;
|
|
58
48
|
}
|
package/dist/azguard.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { AzguardClient } from "@azguardwallet/client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { AztecAddress } from "@aztec/stdlib/aztec-address";
|
|
3
|
+
import { AuthWitness } from "@aztec/stdlib/auth-witness";
|
|
4
|
+
import { ContractInstanceWithAddressSchema, } from "@aztec/stdlib/contract";
|
|
5
|
+
import { TxSimulationResult, UtilitySimulationResult, TxHash, TxReceipt, TxProfileResult } from "@aztec/stdlib/tx";
|
|
6
6
|
import z from "zod";
|
|
7
|
-
import {
|
|
7
|
+
import { ChainInfoSchema } from "@aztec/entrypoints/interfaces";
|
|
8
|
+
import { AddressBookSchema, ContractClassMetadataSchema, ContractMetadataSchema } from "./schemas";
|
|
8
9
|
import { aztecMethods } from "./methods";
|
|
9
10
|
/** Azguard Wallet client fully compatible with Aztec.js' `Wallet` interface */
|
|
10
11
|
export class AztecWallet {
|
|
11
12
|
/**
|
|
12
13
|
* Creates `AztecWallet` instance, connected to Azguard Wallet
|
|
13
14
|
* @param dapp Dapp metadata (default: { name: window.location.hostname })
|
|
14
|
-
* @param chain Chain (default: "
|
|
15
|
+
* @param chain Chain (default: "devnet")
|
|
15
16
|
* @param timeout Timeout in ms for the `window.azguard` object lookup (default: 1000ms)
|
|
16
17
|
* @returns AztecWallet instance
|
|
17
18
|
*/
|
|
@@ -19,11 +20,11 @@ export class AztecWallet {
|
|
|
19
20
|
if (!dapp?.name) {
|
|
20
21
|
dapp = { ...dapp, name: window.location.hostname };
|
|
21
22
|
}
|
|
22
|
-
if (!chain || chain === "
|
|
23
|
-
chain = "aztec:
|
|
23
|
+
if (!chain || chain === "devnet") {
|
|
24
|
+
chain = "aztec:1654394782";
|
|
24
25
|
}
|
|
25
26
|
else if (chain === "sandbox") {
|
|
26
|
-
chain = "aztec:
|
|
27
|
+
chain = "aztec:0";
|
|
27
28
|
}
|
|
28
29
|
const azguard = await AzguardClient.create("aztec.js", timeout ?? 1000);
|
|
29
30
|
const wallet = new AztecWallet(azguard, chain, dapp);
|
|
@@ -53,35 +54,21 @@ export class AztecWallet {
|
|
|
53
54
|
#azguard;
|
|
54
55
|
#chain;
|
|
55
56
|
#dapp;
|
|
56
|
-
#completeAddress;
|
|
57
|
-
#address;
|
|
58
|
-
#chainId;
|
|
59
|
-
#version;
|
|
60
57
|
constructor(azguard, chain, dapp) {
|
|
61
58
|
this.#azguard = azguard;
|
|
62
59
|
this.#chain = chain;
|
|
63
60
|
this.#dapp = dapp;
|
|
64
61
|
this.#azguard.onAccountsChanged.addHandler(this.#onAccountsChanged);
|
|
65
62
|
this.#azguard.onPermissionsChanged.addHandler(this.#onPermissionsChanged);
|
|
66
|
-
this.#azguard.onDisconnected.addHandler(this.#onDisconnected);
|
|
67
63
|
}
|
|
68
|
-
#onAccountsChanged = (
|
|
69
|
-
|
|
70
|
-
if (currentAccount && !accounts.some((x) => x.endsWith(currentAccount))) {
|
|
71
|
-
this.#azguard.disconnect();
|
|
72
|
-
}
|
|
64
|
+
#onAccountsChanged = () => {
|
|
65
|
+
this.#azguard.disconnect();
|
|
73
66
|
};
|
|
74
67
|
#onPermissionsChanged = (permissions) => {
|
|
75
68
|
if (aztecMethods.some((x) => !permissions.some((p) => p.chains?.includes(this.#chain) && p.methods?.includes(x)))) {
|
|
76
69
|
this.#azguard.disconnect();
|
|
77
70
|
}
|
|
78
71
|
};
|
|
79
|
-
#onDisconnected = () => {
|
|
80
|
-
this.#completeAddress = undefined;
|
|
81
|
-
this.#address = undefined;
|
|
82
|
-
this.#chainId = undefined;
|
|
83
|
-
this.#version = undefined;
|
|
84
|
-
};
|
|
85
72
|
async #ensureConnected() {
|
|
86
73
|
if (!this.#azguard.connected) {
|
|
87
74
|
await this.#azguard.connect(this.#dapp, [
|
|
@@ -91,33 +78,6 @@ export class AztecWallet {
|
|
|
91
78
|
},
|
|
92
79
|
]);
|
|
93
80
|
}
|
|
94
|
-
if (!this.#version) {
|
|
95
|
-
const [r1, r2, r3, r4] = await this.#azguard.execute([
|
|
96
|
-
{
|
|
97
|
-
kind: "aztec_getCompleteAddress",
|
|
98
|
-
account: this.#azguard.accounts[0],
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
kind: "aztec_getAddress",
|
|
102
|
-
account: this.#azguard.accounts[0],
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
kind: "aztec_getChainId",
|
|
106
|
-
chain: this.#chain,
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
kind: "aztec_getVersion",
|
|
110
|
-
chain: this.#chain,
|
|
111
|
-
},
|
|
112
|
-
]);
|
|
113
|
-
if (r1.status !== "ok" || r2.status !== "ok" || r3.status !== "ok" || r4.status !== "ok") {
|
|
114
|
-
throw new Error("Failed to initialize aztec wallet");
|
|
115
|
-
}
|
|
116
|
-
this.#completeAddress = await CompleteAddress.schema.parseAsync(r1.result);
|
|
117
|
-
this.#address = await AztecAddress.schema.parseAsync(r2.result);
|
|
118
|
-
this.#chainId = await Fr.schema.parseAsync(r3.result);
|
|
119
|
-
this.#version = await Fr.schema.parseAsync(r4.result);
|
|
120
|
-
}
|
|
121
81
|
}
|
|
122
82
|
async #account() {
|
|
123
83
|
await this.#ensureConnected();
|
|
@@ -134,118 +94,6 @@ export class AztecWallet {
|
|
|
134
94
|
}
|
|
135
95
|
return await schema.parseAsync(result.result);
|
|
136
96
|
}
|
|
137
|
-
getCompleteAddress() {
|
|
138
|
-
if (!this.#completeAddress) {
|
|
139
|
-
throw new Error("Aztec wallet was disconnected by the user");
|
|
140
|
-
}
|
|
141
|
-
return this.#completeAddress;
|
|
142
|
-
}
|
|
143
|
-
getAddress() {
|
|
144
|
-
if (!this.#address) {
|
|
145
|
-
throw new Error("Aztec wallet was disconnected by the user");
|
|
146
|
-
}
|
|
147
|
-
return this.#address;
|
|
148
|
-
}
|
|
149
|
-
getChainId() {
|
|
150
|
-
if (!this.#chainId) {
|
|
151
|
-
throw new Error("Aztec wallet was disconnected by the user");
|
|
152
|
-
}
|
|
153
|
-
return this.#chainId;
|
|
154
|
-
}
|
|
155
|
-
getVersion() {
|
|
156
|
-
if (!this.#version) {
|
|
157
|
-
throw new Error("Aztec wallet was disconnected by the user");
|
|
158
|
-
}
|
|
159
|
-
return this.#version;
|
|
160
|
-
}
|
|
161
|
-
async createTxExecutionRequest(exec, fee, options) {
|
|
162
|
-
let asset;
|
|
163
|
-
try {
|
|
164
|
-
asset = await fee.paymentMethod.getAsset();
|
|
165
|
-
}
|
|
166
|
-
catch { }
|
|
167
|
-
const paymentMethodDto = {
|
|
168
|
-
asset,
|
|
169
|
-
executionPayload: await fee.paymentMethod.getExecutionPayload(fee.gasSettings),
|
|
170
|
-
feePayer: await fee.paymentMethod.getFeePayer(fee.gasSettings),
|
|
171
|
-
};
|
|
172
|
-
return await this.#execute(TxExecutionRequest.schema, {
|
|
173
|
-
kind: "aztec_createTxExecutionRequest",
|
|
174
|
-
account: await this.#account(),
|
|
175
|
-
exec,
|
|
176
|
-
fee: {
|
|
177
|
-
paymentMethod: paymentMethodDto,
|
|
178
|
-
gasSettings: fee.gasSettings,
|
|
179
|
-
},
|
|
180
|
-
options,
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
async createAuthWit(messageHashOrIntent) {
|
|
184
|
-
let intentDto;
|
|
185
|
-
if (typeof messageHashOrIntent === "object" && "caller" in messageHashOrIntent) {
|
|
186
|
-
intentDto = {
|
|
187
|
-
caller: messageHashOrIntent.caller,
|
|
188
|
-
action: messageHashOrIntent.action instanceof ContractFunctionInteraction
|
|
189
|
-
? (await messageHashOrIntent.action.request()).calls[0]
|
|
190
|
-
: messageHashOrIntent.action,
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
else if (typeof messageHashOrIntent === "object" && "consumer" in messageHashOrIntent) {
|
|
194
|
-
intentDto = {
|
|
195
|
-
consumer: messageHashOrIntent.consumer,
|
|
196
|
-
innerHash: new Fr(messageHashOrIntent.innerHash),
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
intentDto = new Fr(messageHashOrIntent);
|
|
201
|
-
}
|
|
202
|
-
return await this.#execute(AuthWitness.schema, {
|
|
203
|
-
kind: "aztec_createAuthWit",
|
|
204
|
-
account: await this.#account(),
|
|
205
|
-
messageHashOrIntent: intentDto,
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
async simulateTx(txRequest, simulatePublic, skipTxValidation, skipFeeEnforcement, overrides, scopes) {
|
|
209
|
-
return await this.#execute(TxSimulationResult.schema, {
|
|
210
|
-
kind: "aztec_simulateTx",
|
|
211
|
-
chain: this.#chain,
|
|
212
|
-
txRequest,
|
|
213
|
-
simulatePublic,
|
|
214
|
-
skipTxValidation,
|
|
215
|
-
skipFeeEnforcement,
|
|
216
|
-
overrides,
|
|
217
|
-
scopes,
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
async simulateUtility(functionName, args, to, authwits, from, scopes) {
|
|
221
|
-
return await this.#execute(UtilitySimulationResult.schema, {
|
|
222
|
-
kind: "aztec_simulateUtility",
|
|
223
|
-
chain: this.#chain,
|
|
224
|
-
functionName,
|
|
225
|
-
args,
|
|
226
|
-
to,
|
|
227
|
-
authwits,
|
|
228
|
-
from,
|
|
229
|
-
scopes,
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
async profileTx(txRequest, profileMode, skipProofGeneration, msgSender) {
|
|
233
|
-
return await this.#execute(TxProfileResult.schema, {
|
|
234
|
-
kind: "aztec_profileTx",
|
|
235
|
-
chain: this.#chain,
|
|
236
|
-
txRequest,
|
|
237
|
-
profileMode,
|
|
238
|
-
skipProofGeneration,
|
|
239
|
-
msgSender,
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
async sendTx(tx) {
|
|
243
|
-
return await this.#execute(TxHash.schema, {
|
|
244
|
-
kind: "aztec_sendTx",
|
|
245
|
-
chain: this.#chain,
|
|
246
|
-
tx,
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
97
|
async getContractClassMetadata(id, includeArtifact) {
|
|
250
98
|
return await this.#execute(ContractClassMetadataSchema, {
|
|
251
99
|
kind: "aztec_getContractClassMetadata",
|
|
@@ -261,99 +109,237 @@ export class AztecWallet {
|
|
|
261
109
|
address,
|
|
262
110
|
});
|
|
263
111
|
}
|
|
264
|
-
async
|
|
265
|
-
return await this.#execute(z.
|
|
266
|
-
kind: "
|
|
112
|
+
async getPrivateEvents(eventMetadata, eventFilter) {
|
|
113
|
+
return await this.#execute(z.any(), {
|
|
114
|
+
kind: "aztec_getPrivateEvents",
|
|
267
115
|
chain: this.#chain,
|
|
268
|
-
|
|
116
|
+
eventMetadata,
|
|
117
|
+
eventFilter,
|
|
269
118
|
});
|
|
270
119
|
}
|
|
271
|
-
async
|
|
272
|
-
return await this.#execute(
|
|
273
|
-
kind: "
|
|
120
|
+
async getChainInfo() {
|
|
121
|
+
return await this.#execute(ChainInfoSchema, {
|
|
122
|
+
kind: "aztec_getChainInfo",
|
|
274
123
|
chain: this.#chain,
|
|
275
|
-
artifact,
|
|
276
124
|
});
|
|
277
125
|
}
|
|
278
|
-
async
|
|
279
|
-
return await this.#execute(
|
|
280
|
-
kind: "
|
|
126
|
+
async getTxReceipt(txHash) {
|
|
127
|
+
return await this.#execute(TxReceipt.schema, {
|
|
128
|
+
kind: "aztec_getTxReceipt",
|
|
281
129
|
chain: this.#chain,
|
|
282
|
-
|
|
283
|
-
privateExecutionResult,
|
|
130
|
+
txHash,
|
|
284
131
|
});
|
|
285
132
|
}
|
|
286
|
-
async
|
|
287
|
-
return await this.#execute(
|
|
288
|
-
kind: "
|
|
133
|
+
async registerSender(address, alias) {
|
|
134
|
+
return await this.#execute(AztecAddress.schema, {
|
|
135
|
+
kind: "aztec_registerSender",
|
|
289
136
|
chain: this.#chain,
|
|
137
|
+
address,
|
|
138
|
+
alias,
|
|
290
139
|
});
|
|
291
140
|
}
|
|
292
|
-
async
|
|
293
|
-
return await this.#execute(
|
|
294
|
-
kind: "
|
|
141
|
+
async getAddressBook() {
|
|
142
|
+
return await this.#execute(AddressBookSchema, {
|
|
143
|
+
kind: "aztec_getAddressBook",
|
|
295
144
|
chain: this.#chain,
|
|
296
145
|
});
|
|
297
146
|
}
|
|
298
|
-
async
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
147
|
+
async getAccounts() {
|
|
148
|
+
await this.#ensureConnected();
|
|
149
|
+
return this.#azguard.accounts.map((x, i) => ({
|
|
150
|
+
alias: `Account ${i + 1}`,
|
|
151
|
+
item: AztecAddress.fromString(x.split(":").at(-1)),
|
|
152
|
+
}));
|
|
303
153
|
}
|
|
304
|
-
async
|
|
305
|
-
return await this.#execute(
|
|
306
|
-
kind: "
|
|
154
|
+
async registerContract(instance, artifact, secretKey) {
|
|
155
|
+
return await this.#execute(ContractInstanceWithAddressSchema, {
|
|
156
|
+
kind: "aztec_registerContract",
|
|
307
157
|
chain: this.#chain,
|
|
308
|
-
|
|
158
|
+
instance,
|
|
309
159
|
artifact,
|
|
160
|
+
secretKey,
|
|
310
161
|
});
|
|
311
162
|
}
|
|
312
|
-
async
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
163
|
+
async simulateTx(exec, opts) {
|
|
164
|
+
await this.#ensureConnected();
|
|
165
|
+
const account = this.#azguard.accounts.find((x) => x.endsWith(opts?.from?.toString()));
|
|
166
|
+
if (!account) {
|
|
167
|
+
throw new Error("Unauthorized 'from' account");
|
|
168
|
+
}
|
|
169
|
+
return await this.#execute(TxSimulationResult.schema, {
|
|
170
|
+
kind: "aztec_simulateTx",
|
|
171
|
+
account,
|
|
172
|
+
exec,
|
|
173
|
+
opts,
|
|
317
174
|
});
|
|
318
175
|
}
|
|
319
|
-
async
|
|
320
|
-
return await this.#execute(
|
|
321
|
-
kind: "
|
|
322
|
-
|
|
176
|
+
async simulateUtility(call, authwits) {
|
|
177
|
+
return await this.#execute(UtilitySimulationResult.schema, {
|
|
178
|
+
kind: "aztec_simulateUtility",
|
|
179
|
+
account: await this.#account(),
|
|
180
|
+
call,
|
|
181
|
+
authwits,
|
|
323
182
|
});
|
|
324
183
|
}
|
|
325
|
-
async
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
184
|
+
async profileTx(exec, opts) {
|
|
185
|
+
await this.#ensureConnected();
|
|
186
|
+
const account = this.#azguard.accounts.find((x) => x.endsWith(opts?.from?.toString()));
|
|
187
|
+
if (!account) {
|
|
188
|
+
throw new Error("Unauthorized 'from' account");
|
|
189
|
+
}
|
|
190
|
+
return await this.#execute(TxProfileResult.schema, {
|
|
191
|
+
kind: "aztec_profileTx",
|
|
192
|
+
account,
|
|
193
|
+
exec,
|
|
194
|
+
opts,
|
|
330
195
|
});
|
|
331
196
|
}
|
|
332
|
-
async
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
197
|
+
async sendTx(exec, opts) {
|
|
198
|
+
await this.#ensureConnected();
|
|
199
|
+
const account = this.#azguard.accounts.find((x) => x.endsWith(opts?.from?.toString()));
|
|
200
|
+
if (!account) {
|
|
201
|
+
throw new Error("Unauthorized 'from' account");
|
|
202
|
+
}
|
|
203
|
+
return await this.#execute(TxHash.schema, {
|
|
204
|
+
kind: "aztec_sendTx",
|
|
205
|
+
account,
|
|
206
|
+
exec,
|
|
207
|
+
opts,
|
|
337
208
|
});
|
|
338
209
|
}
|
|
339
|
-
async
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
210
|
+
async createAuthWit(from, messageHashOrIntent) {
|
|
211
|
+
await this.#ensureConnected();
|
|
212
|
+
const account = this.#azguard.accounts.find((x) => x.endsWith(from?.toString()));
|
|
213
|
+
if (!account) {
|
|
214
|
+
throw new Error("Unauthorized 'from' account");
|
|
215
|
+
}
|
|
216
|
+
return await this.#execute(AuthWitness.schema, {
|
|
217
|
+
kind: "aztec_createAuthWit",
|
|
218
|
+
account,
|
|
219
|
+
messageHashOrIntent,
|
|
348
220
|
});
|
|
349
221
|
}
|
|
350
|
-
async
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
222
|
+
async batch(methods) {
|
|
223
|
+
await this.#ensureConnected();
|
|
224
|
+
const operations = [];
|
|
225
|
+
for (const method of methods) {
|
|
226
|
+
switch (method.name) {
|
|
227
|
+
case "registerContract": {
|
|
228
|
+
const [instance, artifact, secretKey] = method.args;
|
|
229
|
+
operations.push({
|
|
230
|
+
kind: "aztec_registerContract",
|
|
231
|
+
chain: this.#chain,
|
|
232
|
+
instance,
|
|
233
|
+
artifact,
|
|
234
|
+
secretKey,
|
|
235
|
+
});
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
case "registerSender": {
|
|
239
|
+
const [address, alias] = method.args;
|
|
240
|
+
operations.push({
|
|
241
|
+
kind: "aztec_registerSender",
|
|
242
|
+
chain: this.#chain,
|
|
243
|
+
address,
|
|
244
|
+
alias,
|
|
245
|
+
});
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
case "sendTx": {
|
|
249
|
+
const [exec, opts] = method.args;
|
|
250
|
+
const account = this.#azguard.accounts.find((x) => x.endsWith(opts?.from?.toString()));
|
|
251
|
+
if (!account) {
|
|
252
|
+
throw new Error("Unauthorized 'from' account");
|
|
253
|
+
}
|
|
254
|
+
operations.push({
|
|
255
|
+
kind: "aztec_sendTx",
|
|
256
|
+
account,
|
|
257
|
+
exec,
|
|
258
|
+
opts,
|
|
259
|
+
});
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
case "simulateTx": {
|
|
263
|
+
const [exec, opts] = method.args;
|
|
264
|
+
const account = this.#azguard.accounts.find((x) => x.endsWith(opts?.from?.toString()));
|
|
265
|
+
if (!account) {
|
|
266
|
+
throw new Error("Unauthorized 'from' account");
|
|
267
|
+
}
|
|
268
|
+
operations.push({
|
|
269
|
+
kind: "aztec_simulateTx",
|
|
270
|
+
account,
|
|
271
|
+
exec,
|
|
272
|
+
opts,
|
|
273
|
+
});
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
case "simulateUtility": {
|
|
277
|
+
const [call, authwits] = method.args;
|
|
278
|
+
operations.push({
|
|
279
|
+
kind: "aztec_simulateUtility",
|
|
280
|
+
account: await this.#account(),
|
|
281
|
+
call,
|
|
282
|
+
authwits,
|
|
283
|
+
});
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
286
|
+
default: {
|
|
287
|
+
throw new Error("Unsupported batch method");
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
const results = await this.#azguard.execute(operations);
|
|
292
|
+
const output = [];
|
|
293
|
+
for (let i = 0; i < results.length; i++) {
|
|
294
|
+
const method = methods[i].name;
|
|
295
|
+
const result = results[i];
|
|
296
|
+
if (result.status === "failed") {
|
|
297
|
+
throw new Error(`${method} failed with '${result.error}'`);
|
|
298
|
+
}
|
|
299
|
+
if (result.status === "skipped") {
|
|
300
|
+
throw new Error(`${method} was skipped`);
|
|
301
|
+
}
|
|
302
|
+
switch (method) {
|
|
303
|
+
case "registerContract": {
|
|
304
|
+
output.push({
|
|
305
|
+
method,
|
|
306
|
+
result: await ContractInstanceWithAddressSchema.parseAsync(result.result),
|
|
307
|
+
});
|
|
308
|
+
break;
|
|
309
|
+
}
|
|
310
|
+
case "registerSender": {
|
|
311
|
+
output.push({
|
|
312
|
+
method,
|
|
313
|
+
result: await AztecAddress.schema.parseAsync(result.result),
|
|
314
|
+
});
|
|
315
|
+
break;
|
|
316
|
+
}
|
|
317
|
+
case "sendTx": {
|
|
318
|
+
output.push({
|
|
319
|
+
method,
|
|
320
|
+
result: await TxHash.schema.parseAsync(result.result),
|
|
321
|
+
});
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
case "simulateTx": {
|
|
325
|
+
output.push({
|
|
326
|
+
method,
|
|
327
|
+
result: await TxSimulationResult.schema.parseAsync(result.result),
|
|
328
|
+
});
|
|
329
|
+
break;
|
|
330
|
+
}
|
|
331
|
+
case "simulateUtility": {
|
|
332
|
+
output.push({
|
|
333
|
+
method,
|
|
334
|
+
result: await UtilitySimulationResult.schema.parseAsync(result.result),
|
|
335
|
+
});
|
|
336
|
+
break;
|
|
337
|
+
}
|
|
338
|
+
default: {
|
|
339
|
+
throw new Error("Unsupported batch method");
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return output;
|
|
358
344
|
}
|
|
359
345
|
}
|
package/dist/methods.js
CHANGED
|
@@ -1,27 +1,15 @@
|
|
|
1
1
|
export const aztecMethods = [
|
|
2
|
+
"aztec_getContractClassMetadata",
|
|
3
|
+
"aztec_getContractMetadata",
|
|
4
|
+
"aztec_getPrivateEvents",
|
|
5
|
+
"aztec_getChainInfo",
|
|
6
|
+
"aztec_getTxReceipt",
|
|
7
|
+
"aztec_registerSender",
|
|
8
|
+
"aztec_getAddressBook",
|
|
9
|
+
"aztec_registerContract",
|
|
2
10
|
"aztec_simulateTx",
|
|
3
11
|
"aztec_simulateUtility",
|
|
4
12
|
"aztec_profileTx",
|
|
5
13
|
"aztec_sendTx",
|
|
6
|
-
"aztec_getContractClassMetadata",
|
|
7
|
-
"aztec_getContractMetadata",
|
|
8
|
-
"aztec_registerContract",
|
|
9
|
-
"aztec_registerContractClass",
|
|
10
|
-
"aztec_proveTx",
|
|
11
|
-
"aztec_getNodeInfo",
|
|
12
|
-
"aztec_getPXEInfo",
|
|
13
|
-
"aztec_getCurrentBaseFees",
|
|
14
|
-
"aztec_updateContract",
|
|
15
|
-
"aztec_registerSender",
|
|
16
|
-
"aztec_getSenders",
|
|
17
|
-
"aztec_removeSender",
|
|
18
|
-
"aztec_getTxReceipt",
|
|
19
|
-
"aztec_getPrivateEvents",
|
|
20
|
-
"aztec_getPublicEvents",
|
|
21
|
-
"aztec_getCompleteAddress",
|
|
22
|
-
"aztec_getAddress",
|
|
23
|
-
"aztec_getChainId",
|
|
24
|
-
"aztec_getVersion",
|
|
25
|
-
"aztec_createTxExecutionRequest",
|
|
26
14
|
"aztec_createAuthWit",
|
|
27
15
|
];
|
package/dist/schemas.d.ts
CHANGED
|
@@ -1,227 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Aliased } from "@aztec/aztec.js/wallet";
|
|
2
2
|
import { ZodFor } from "@aztec/foundation/schemas";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
vkHash: z.ZodType<import("@aztec/aztec.js").Fr, any, string>;
|
|
11
|
-
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
selector: import("@aztec/aztec.js").FunctionSelector;
|
|
13
|
-
vkHash: import("@aztec/aztec.js").Fr;
|
|
14
|
-
}, {
|
|
15
|
-
vkHash: string;
|
|
16
|
-
selector?: any;
|
|
17
|
-
}>, "many">;
|
|
18
|
-
packedBytecode: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Buffer<ArrayBuffer>, string>, z.ZodEffects<z.ZodObject<{
|
|
19
|
-
type: z.ZodLiteral<"Buffer">;
|
|
20
|
-
data: z.ZodArray<z.ZodNumber, "many">;
|
|
21
|
-
}, "strip", z.ZodTypeAny, {
|
|
22
|
-
type: "Buffer";
|
|
23
|
-
data: number[];
|
|
24
|
-
}, {
|
|
25
|
-
type: "Buffer";
|
|
26
|
-
data: number[];
|
|
27
|
-
}>, Buffer<ArrayBuffer>, {
|
|
28
|
-
type: "Buffer";
|
|
29
|
-
data: number[];
|
|
30
|
-
}>]>;
|
|
31
|
-
} & {
|
|
32
|
-
id: z.ZodType<import("@aztec/aztec.js").Fr, any, string>;
|
|
33
|
-
}, "strip", z.ZodTypeAny, {
|
|
34
|
-
version: 1;
|
|
35
|
-
id: import("@aztec/aztec.js").Fr;
|
|
36
|
-
artifactHash: import("@aztec/aztec.js").Fr;
|
|
37
|
-
packedBytecode: Buffer<ArrayBuffer>;
|
|
38
|
-
privateFunctions: {
|
|
39
|
-
selector: import("@aztec/aztec.js").FunctionSelector;
|
|
40
|
-
vkHash: import("@aztec/aztec.js").Fr;
|
|
41
|
-
}[];
|
|
42
|
-
}, {
|
|
43
|
-
version: 1;
|
|
44
|
-
id: string;
|
|
45
|
-
artifactHash: string;
|
|
46
|
-
packedBytecode: string | {
|
|
47
|
-
type: "Buffer";
|
|
48
|
-
data: number[];
|
|
49
|
-
};
|
|
50
|
-
privateFunctions: {
|
|
51
|
-
vkHash: string;
|
|
52
|
-
selector?: any;
|
|
53
|
-
}[];
|
|
54
|
-
}>, z.ZodUndefined]>;
|
|
55
|
-
isContractClassPubliclyRegistered: z.ZodBoolean;
|
|
56
|
-
artifact: z.ZodUnion<[ZodFor<import("@aztec/aztec.js").ContractArtifact>, z.ZodUndefined]>;
|
|
57
|
-
}, "strip", z.ZodTypeAny, {
|
|
58
|
-
isContractClassPubliclyRegistered: boolean;
|
|
59
|
-
contractClass?: {
|
|
60
|
-
version: 1;
|
|
61
|
-
id: import("@aztec/aztec.js").Fr;
|
|
62
|
-
artifactHash: import("@aztec/aztec.js").Fr;
|
|
63
|
-
packedBytecode: Buffer<ArrayBuffer>;
|
|
64
|
-
privateFunctions: {
|
|
65
|
-
selector: import("@aztec/aztec.js").FunctionSelector;
|
|
66
|
-
vkHash: import("@aztec/aztec.js").Fr;
|
|
67
|
-
}[];
|
|
68
|
-
} | undefined;
|
|
69
|
-
artifact?: import("@aztec/aztec.js").ContractArtifact | undefined;
|
|
70
|
-
}, {
|
|
71
|
-
isContractClassPubliclyRegistered: boolean;
|
|
72
|
-
contractClass?: {
|
|
73
|
-
version: 1;
|
|
74
|
-
id: string;
|
|
75
|
-
artifactHash: string;
|
|
76
|
-
packedBytecode: string | {
|
|
77
|
-
type: "Buffer";
|
|
78
|
-
data: number[];
|
|
79
|
-
};
|
|
80
|
-
privateFunctions: {
|
|
81
|
-
vkHash: string;
|
|
82
|
-
selector?: any;
|
|
83
|
-
}[];
|
|
84
|
-
} | undefined;
|
|
85
|
-
artifact?: any;
|
|
86
|
-
}>;
|
|
87
|
-
export declare const ContractMetadataSchema: z.ZodObject<{
|
|
88
|
-
contractInstance: z.ZodUnion<[z.ZodIntersection<z.ZodObject<{
|
|
89
|
-
version: z.ZodLiteral<1>;
|
|
90
|
-
salt: ZodFor<import("@aztec/aztec.js").Fr>;
|
|
91
|
-
deployer: ZodFor<import("@aztec/aztec.js").AztecAddress>;
|
|
92
|
-
currentContractClassId: ZodFor<import("@aztec/aztec.js").Fr>;
|
|
93
|
-
originalContractClassId: ZodFor<import("@aztec/aztec.js").Fr>;
|
|
94
|
-
initializationHash: ZodFor<import("@aztec/aztec.js").Fr>;
|
|
95
|
-
publicKeys: z.ZodEffects<z.ZodObject<{
|
|
96
|
-
masterNullifierPublicKey: z.ZodType<import("@aztec/aztec.js").Point, any, string>;
|
|
97
|
-
masterIncomingViewingPublicKey: z.ZodType<import("@aztec/aztec.js").Point, any, string>;
|
|
98
|
-
masterOutgoingViewingPublicKey: z.ZodType<import("@aztec/aztec.js").Point, any, string>;
|
|
99
|
-
masterTaggingPublicKey: z.ZodType<import("@aztec/aztec.js").Point, any, string>;
|
|
100
|
-
}, "strip", z.ZodTypeAny, {
|
|
101
|
-
masterNullifierPublicKey: import("@aztec/aztec.js").Point;
|
|
102
|
-
masterIncomingViewingPublicKey: import("@aztec/aztec.js").Point;
|
|
103
|
-
masterOutgoingViewingPublicKey: import("@aztec/aztec.js").Point;
|
|
104
|
-
masterTaggingPublicKey: import("@aztec/aztec.js").Point;
|
|
105
|
-
}, {
|
|
106
|
-
masterNullifierPublicKey: string;
|
|
107
|
-
masterIncomingViewingPublicKey: string;
|
|
108
|
-
masterOutgoingViewingPublicKey: string;
|
|
109
|
-
masterTaggingPublicKey: string;
|
|
110
|
-
}>, import("@aztec/aztec.js").PublicKeys, {
|
|
111
|
-
masterNullifierPublicKey: string;
|
|
112
|
-
masterIncomingViewingPublicKey: string;
|
|
113
|
-
masterOutgoingViewingPublicKey: string;
|
|
114
|
-
masterTaggingPublicKey: string;
|
|
115
|
-
}>;
|
|
116
|
-
}, "strip", z.ZodTypeAny, {
|
|
117
|
-
version: 1;
|
|
118
|
-
salt: import("@aztec/aztec.js").Fr;
|
|
119
|
-
publicKeys: import("@aztec/aztec.js").PublicKeys;
|
|
120
|
-
deployer: import("@aztec/aztec.js").AztecAddress;
|
|
121
|
-
currentContractClassId: import("@aztec/aztec.js").Fr;
|
|
122
|
-
originalContractClassId: import("@aztec/aztec.js").Fr;
|
|
123
|
-
initializationHash: import("@aztec/aztec.js").Fr;
|
|
124
|
-
}, {
|
|
125
|
-
version: 1;
|
|
126
|
-
publicKeys: {
|
|
127
|
-
masterNullifierPublicKey: string;
|
|
128
|
-
masterIncomingViewingPublicKey: string;
|
|
129
|
-
masterOutgoingViewingPublicKey: string;
|
|
130
|
-
masterTaggingPublicKey: string;
|
|
131
|
-
};
|
|
132
|
-
salt?: any;
|
|
133
|
-
deployer?: any;
|
|
134
|
-
currentContractClassId?: any;
|
|
135
|
-
originalContractClassId?: any;
|
|
136
|
-
initializationHash?: any;
|
|
137
|
-
}>, z.ZodObject<{
|
|
138
|
-
address: ZodFor<import("@aztec/aztec.js").AztecAddress>;
|
|
139
|
-
}, "strip", z.ZodTypeAny, {
|
|
140
|
-
address: import("@aztec/aztec.js").AztecAddress;
|
|
141
|
-
}, {
|
|
142
|
-
address?: any;
|
|
143
|
-
}>>, z.ZodUndefined]>;
|
|
144
|
-
isContractInitialized: z.ZodBoolean;
|
|
145
|
-
isContractPublished: z.ZodBoolean;
|
|
146
|
-
}, "strip", z.ZodTypeAny, {
|
|
147
|
-
isContractInitialized: boolean;
|
|
148
|
-
isContractPublished: boolean;
|
|
149
|
-
contractInstance?: ({
|
|
150
|
-
version: 1;
|
|
151
|
-
salt: import("@aztec/aztec.js").Fr;
|
|
152
|
-
publicKeys: import("@aztec/aztec.js").PublicKeys;
|
|
153
|
-
deployer: import("@aztec/aztec.js").AztecAddress;
|
|
154
|
-
currentContractClassId: import("@aztec/aztec.js").Fr;
|
|
155
|
-
originalContractClassId: import("@aztec/aztec.js").Fr;
|
|
156
|
-
initializationHash: import("@aztec/aztec.js").Fr;
|
|
157
|
-
} & {
|
|
158
|
-
address: import("@aztec/aztec.js").AztecAddress;
|
|
159
|
-
}) | undefined;
|
|
160
|
-
}, {
|
|
161
|
-
isContractInitialized: boolean;
|
|
162
|
-
isContractPublished: boolean;
|
|
163
|
-
contractInstance?: ({
|
|
164
|
-
version: 1;
|
|
165
|
-
publicKeys: {
|
|
166
|
-
masterNullifierPublicKey: string;
|
|
167
|
-
masterIncomingViewingPublicKey: string;
|
|
168
|
-
masterOutgoingViewingPublicKey: string;
|
|
169
|
-
masterTaggingPublicKey: string;
|
|
170
|
-
};
|
|
171
|
-
salt?: any;
|
|
172
|
-
deployer?: any;
|
|
173
|
-
currentContractClassId?: any;
|
|
174
|
-
originalContractClassId?: any;
|
|
175
|
-
initializationHash?: any;
|
|
176
|
-
} & {
|
|
177
|
-
address?: any;
|
|
178
|
-
}) | undefined;
|
|
179
|
-
}>;
|
|
180
|
-
export declare const PXEInfoSchema: z.ZodObject<{
|
|
181
|
-
pxeVersion: z.ZodString;
|
|
182
|
-
protocolContractAddresses: z.ZodObject<{
|
|
183
|
-
classRegistry: import("@aztec/stdlib/schemas").ZodFor<import("@aztec/aztec.js").AztecAddress>;
|
|
184
|
-
feeJuice: import("@aztec/stdlib/schemas").ZodFor<import("@aztec/aztec.js").AztecAddress>;
|
|
185
|
-
instanceRegistry: import("@aztec/stdlib/schemas").ZodFor<import("@aztec/aztec.js").AztecAddress>;
|
|
186
|
-
multiCallEntrypoint: import("@aztec/stdlib/schemas").ZodFor<import("@aztec/aztec.js").AztecAddress>;
|
|
187
|
-
}, "strip", z.ZodTypeAny, {
|
|
188
|
-
classRegistry: import("@aztec/aztec.js").AztecAddress;
|
|
189
|
-
feeJuice: import("@aztec/aztec.js").AztecAddress;
|
|
190
|
-
instanceRegistry: import("@aztec/aztec.js").AztecAddress;
|
|
191
|
-
multiCallEntrypoint: import("@aztec/aztec.js").AztecAddress;
|
|
192
|
-
}, {
|
|
193
|
-
classRegistry?: any;
|
|
194
|
-
feeJuice?: any;
|
|
195
|
-
instanceRegistry?: any;
|
|
196
|
-
multiCallEntrypoint?: any;
|
|
197
|
-
}>;
|
|
198
|
-
}, "strip", z.ZodTypeAny, {
|
|
199
|
-
pxeVersion: string;
|
|
200
|
-
protocolContractAddresses: {
|
|
201
|
-
classRegistry: import("@aztec/aztec.js").AztecAddress;
|
|
202
|
-
feeJuice: import("@aztec/aztec.js").AztecAddress;
|
|
203
|
-
instanceRegistry: import("@aztec/aztec.js").AztecAddress;
|
|
204
|
-
multiCallEntrypoint: import("@aztec/aztec.js").AztecAddress;
|
|
205
|
-
};
|
|
206
|
-
}, {
|
|
207
|
-
pxeVersion: string;
|
|
208
|
-
protocolContractAddresses: {
|
|
209
|
-
classRegistry?: any;
|
|
210
|
-
feeJuice?: any;
|
|
211
|
-
instanceRegistry?: any;
|
|
212
|
-
multiCallEntrypoint?: any;
|
|
213
|
-
};
|
|
214
|
-
}>;
|
|
215
|
-
export declare const EventMetadataDefinitionSchema: z.ZodObject<{
|
|
216
|
-
eventSelector: z.ZodType<EventSelector, any, string>;
|
|
217
|
-
abiType: z.ZodType<import("@aztec/aztec.js").AbiType, z.ZodTypeDef, import("@aztec/aztec.js").AbiType>;
|
|
218
|
-
fieldNames: z.ZodArray<z.ZodString, "many">;
|
|
219
|
-
}, "strip", z.ZodTypeAny, {
|
|
220
|
-
eventSelector: EventSelector;
|
|
221
|
-
abiType: import("@aztec/aztec.js").AbiType;
|
|
222
|
-
fieldNames: string[];
|
|
223
|
-
}, {
|
|
224
|
-
eventSelector: string;
|
|
225
|
-
abiType: import("@aztec/aztec.js").AbiType;
|
|
226
|
-
fieldNames: string[];
|
|
227
|
-
}>;
|
|
3
|
+
import { EventMetadataDefinition } from "@aztec/stdlib/abi";
|
|
4
|
+
import { AztecAddress } from "@aztec/stdlib/aztec-address";
|
|
5
|
+
import { ContractClassMetadata, ContractMetadata } from "@aztec/stdlib/contract";
|
|
6
|
+
export declare const ContractClassMetadataSchema: ZodFor<ContractClassMetadata>;
|
|
7
|
+
export declare const ContractMetadataSchema: ZodFor<ContractMetadata>;
|
|
8
|
+
export declare const EventMetadataDefinitionSchema: ZodFor<EventMetadataDefinition>;
|
|
9
|
+
export declare const AddressBookSchema: ZodFor<Aliased<AztecAddress>[]>;
|
package/dist/schemas.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AbiTypeSchema, ContractArtifactSchema, EventSelector } from "@aztec/stdlib/abi";
|
|
2
|
-
import {
|
|
2
|
+
import { AztecAddress } from "@aztec/stdlib/aztec-address";
|
|
3
|
+
import { ContractClassWithIdSchema, ContractInstanceWithAddressSchema, } from "@aztec/stdlib/contract";
|
|
3
4
|
import z from "zod";
|
|
4
5
|
// copied from aztec.js, because it's not exported
|
|
5
6
|
export const ContractClassMetadataSchema = z.object({
|
|
@@ -12,12 +13,12 @@ export const ContractMetadataSchema = z.object({
|
|
|
12
13
|
isContractInitialized: z.boolean(),
|
|
13
14
|
isContractPublished: z.boolean(),
|
|
14
15
|
});
|
|
15
|
-
export const PXEInfoSchema = z.object({
|
|
16
|
-
pxeVersion: z.string(),
|
|
17
|
-
protocolContractAddresses: ProtocolContractAddressesSchema,
|
|
18
|
-
});
|
|
19
16
|
export const EventMetadataDefinitionSchema = z.object({
|
|
20
17
|
eventSelector: EventSelector.schema,
|
|
21
18
|
abiType: AbiTypeSchema,
|
|
22
19
|
fieldNames: z.array(z.string()),
|
|
23
20
|
});
|
|
21
|
+
export const AddressBookSchema = z.array(z.object({
|
|
22
|
+
alias: z.string(),
|
|
23
|
+
item: AztecAddress.schema,
|
|
24
|
+
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azguardwallet/aztec-wallet",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-devnet.20251212",
|
|
4
4
|
"description": "Azguard Wallet client fully compatible with Aztec.js' Wallet interface",
|
|
5
5
|
"author": "Azguard Wallet",
|
|
6
6
|
"homepage": "https://github.com/AzguardWallet/aztec-wallet",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"build": "rm -rf dist && tsc"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@azguardwallet/client": "0.
|
|
26
|
-
"@azguardwallet/types": "0.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
"@azguardwallet/client": "0.7.0",
|
|
26
|
+
"@azguardwallet/types": "0.7.0",
|
|
27
|
+
"@aztec/aztec.js": "3.0.0-devnet.20251212",
|
|
28
|
+
"@aztec/entrypoints": "3.0.0-devnet.20251212",
|
|
29
|
+
"@aztec/foundation": "3.0.0-devnet.20251212",
|
|
30
|
+
"@aztec/stdlib": "3.0.0-devnet.20251212",
|
|
31
|
+
"zod": "^3.23.8"
|
|
32
32
|
}
|
|
33
33
|
}
|