@aztec/wallet-sdk 4.0.0-nightly.20260108 → 4.0.0-nightly.20260110
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 +172 -138
- package/dest/crypto.d.ts +146 -0
- package/dest/crypto.d.ts.map +1 -0
- package/dest/crypto.js +216 -0
- package/dest/manager/index.d.ts +2 -2
- package/dest/manager/index.d.ts.map +1 -1
- package/dest/manager/wallet_manager.js +1 -1
- package/dest/providers/extension/extension_provider.d.ts +2 -2
- package/dest/providers/extension/extension_provider.d.ts.map +1 -1
- package/dest/providers/extension/extension_wallet.d.ts +79 -7
- package/dest/providers/extension/extension_wallet.d.ts.map +1 -1
- package/dest/providers/extension/extension_wallet.js +173 -44
- package/dest/providers/extension/index.d.ts +3 -2
- package/dest/providers/extension/index.d.ts.map +1 -1
- package/dest/providers/extension/index.js +1 -0
- package/dest/types.d.ts +83 -0
- package/dest/types.d.ts.map +1 -0
- package/dest/types.js +3 -0
- package/package.json +10 -8
- package/src/crypto.ts +283 -0
- package/src/manager/index.ts +1 -7
- package/src/manager/wallet_manager.ts +1 -1
- package/src/providers/extension/extension_provider.ts +1 -1
- package/src/providers/extension/extension_wallet.ts +206 -55
- package/src/providers/extension/index.ts +9 -1
- package/src/{providers/types.ts → types.ts} +22 -4
- package/dest/providers/types.d.ts +0 -67
- package/dest/providers/types.d.ts.map +0 -1
- package/dest/providers/types.js +0 -3
|
@@ -5,29 +5,74 @@ import { type PromiseWithResolvers, promiseWithResolvers } from '@aztec/foundati
|
|
|
5
5
|
import { schemaHasMethod } from '@aztec/foundation/schemas';
|
|
6
6
|
import type { FunctionsOf } from '@aztec/foundation/types';
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import {
|
|
9
|
+
type EncryptedPayload,
|
|
10
|
+
type ExportedPublicKey,
|
|
11
|
+
decrypt,
|
|
12
|
+
deriveSharedKey,
|
|
13
|
+
encrypt,
|
|
14
|
+
exportPublicKey,
|
|
15
|
+
generateKeyPair,
|
|
16
|
+
importPublicKey,
|
|
17
|
+
} from '../../crypto.js';
|
|
18
|
+
import type { ConnectRequest, WalletInfo, WalletMessage, WalletResponse } from '../../types.js';
|
|
9
19
|
|
|
10
20
|
/**
|
|
11
|
-
*
|
|
21
|
+
* Internal type representing a wallet method call before encryption.
|
|
22
|
+
* @internal
|
|
12
23
|
*/
|
|
13
24
|
type WalletMethodCall = {
|
|
14
|
-
/**
|
|
15
|
-
* The wallet method name to invoke
|
|
16
|
-
*/
|
|
25
|
+
/** The wallet method name to invoke */
|
|
17
26
|
type: keyof FunctionsOf<Wallet>;
|
|
18
|
-
/**
|
|
19
|
-
* Arguments to pass to the wallet method
|
|
20
|
-
*/
|
|
27
|
+
/** Arguments to pass to the wallet method */
|
|
21
28
|
args: unknown[];
|
|
22
29
|
};
|
|
23
30
|
|
|
24
31
|
/**
|
|
25
32
|
* A wallet implementation that communicates with browser extension wallets
|
|
26
|
-
*
|
|
33
|
+
* using a secure encrypted MessageChannel.
|
|
34
|
+
*
|
|
35
|
+
* This class establishes a private communication channel with a wallet extension
|
|
36
|
+
* using the following security mechanisms:
|
|
37
|
+
*
|
|
38
|
+
* 1. **MessageChannel**: Creates a private communication channel that is not
|
|
39
|
+
* visible to other scripts on the page (unlike window.postMessage).
|
|
40
|
+
*
|
|
41
|
+
* 2. **ECDH Key Exchange**: Uses Elliptic Curve Diffie-Hellman to derive a
|
|
42
|
+
* shared secret between the dApp and wallet without transmitting private keys.
|
|
43
|
+
*
|
|
44
|
+
* 3. **AES-GCM Encryption**: All messages after channel establishment are
|
|
45
|
+
* encrypted using AES-256-GCM, providing both confidentiality and authenticity.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* // Discovery returns wallet info including the wallet's public key
|
|
50
|
+
* const wallets = await ExtensionProvider.discoverExtensions(chainInfo);
|
|
51
|
+
* const walletInfo = wallets[0];
|
|
52
|
+
*
|
|
53
|
+
* // Create a secure connection to the wallet
|
|
54
|
+
* const wallet = await ExtensionWallet.create(walletInfo, chainInfo, 'my-dapp');
|
|
55
|
+
*
|
|
56
|
+
* // All subsequent calls are encrypted
|
|
57
|
+
* const accounts = await wallet.getAccounts();
|
|
58
|
+
* ```
|
|
27
59
|
*/
|
|
28
60
|
export class ExtensionWallet {
|
|
61
|
+
/** Map of pending requests awaiting responses, keyed by message ID */
|
|
29
62
|
private inFlight = new Map<string, PromiseWithResolvers<unknown>>();
|
|
30
63
|
|
|
64
|
+
/** The MessagePort for private communication with the extension */
|
|
65
|
+
private port: MessagePort | null = null;
|
|
66
|
+
|
|
67
|
+
/** The derived AES-GCM key for encrypting/decrypting messages */
|
|
68
|
+
private sharedKey: CryptoKey | null = null;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Private constructor - use {@link ExtensionWallet.create} to instantiate.
|
|
72
|
+
* @param chainInfo - The chain information (chainId and version)
|
|
73
|
+
* @param appId - Application identifier for the requesting dApp
|
|
74
|
+
* @param extensionId - The unique identifier of the target wallet extension
|
|
75
|
+
*/
|
|
31
76
|
private constructor(
|
|
32
77
|
private chainInfo: ChainInfo,
|
|
33
78
|
private appId: string,
|
|
@@ -36,75 +81,157 @@ export class ExtensionWallet {
|
|
|
36
81
|
|
|
37
82
|
/**
|
|
38
83
|
* Creates an ExtensionWallet instance that proxies wallet calls to a browser extension
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
84
|
+
* over a secure encrypted MessageChannel.
|
|
85
|
+
*
|
|
86
|
+
* The connection process:
|
|
87
|
+
* 1. Generates an ECDH key pair for this session
|
|
88
|
+
* 2. Derives a shared AES-256 key using the wallet's public key
|
|
89
|
+
* 3. Creates a MessageChannel and transfers one port to the extension
|
|
90
|
+
* 4. Returns a Proxy that encrypts all wallet method calls
|
|
91
|
+
*
|
|
92
|
+
* @param walletInfo - The discovered wallet information, including the wallet's ECDH public key
|
|
93
|
+
* @param chainInfo - The chain information (chainId and version) for request context
|
|
94
|
+
* @param appId - Application identifier used to identify the requesting dApp to the wallet
|
|
95
|
+
* @returns A Promise resolving to a Wallet implementation that encrypts all communication
|
|
96
|
+
*
|
|
97
|
+
* @throws Error if the secure channel cannot be established
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* const wallet = await ExtensionWallet.create(
|
|
102
|
+
* walletInfo,
|
|
103
|
+
* { chainId: Fr(31337), version: Fr(0) },
|
|
104
|
+
* 'my-defi-app'
|
|
105
|
+
* );
|
|
106
|
+
* ```
|
|
43
107
|
*/
|
|
44
|
-
static create(
|
|
45
|
-
const wallet = new ExtensionWallet(chainInfo, appId,
|
|
108
|
+
static async create(walletInfo: WalletInfo, chainInfo: ChainInfo, appId: string): Promise<Wallet> {
|
|
109
|
+
const wallet = new ExtensionWallet(chainInfo, appId, walletInfo.id);
|
|
46
110
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
111
|
+
if (!walletInfo.publicKey) {
|
|
112
|
+
throw new Error('Wallet does not support secure channel establishment (missing public key)');
|
|
113
|
+
}
|
|
52
114
|
|
|
53
|
-
|
|
54
|
-
try {
|
|
55
|
-
data = JSON.parse(event.data);
|
|
56
|
-
} catch {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
115
|
+
await wallet.establishSecureChannel(walletInfo.publicKey);
|
|
59
116
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
117
|
+
// Create a Proxy that intercepts wallet method calls and forwards them to the extension
|
|
118
|
+
return new Proxy(wallet, {
|
|
119
|
+
get: (target, prop) => {
|
|
120
|
+
if (schemaHasMethod(WalletSchema, prop.toString())) {
|
|
121
|
+
return async (...args: unknown[]) => {
|
|
122
|
+
const result = await target.postMessage({
|
|
123
|
+
type: prop.toString() as keyof FunctionsOf<Wallet>,
|
|
124
|
+
args,
|
|
125
|
+
});
|
|
126
|
+
return WalletSchema[prop.toString() as keyof typeof WalletSchema].returnType().parseAsync(result);
|
|
127
|
+
};
|
|
128
|
+
} else {
|
|
129
|
+
return target[prop as keyof ExtensionWallet];
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
}) as unknown as Wallet;
|
|
133
|
+
}
|
|
64
134
|
|
|
65
|
-
|
|
135
|
+
/**
|
|
136
|
+
* Establishes a secure MessageChannel with ECDH key exchange.
|
|
137
|
+
*
|
|
138
|
+
* This method performs the cryptographic handshake:
|
|
139
|
+
* 1. Generates a new ECDH P-256 key pair for this session
|
|
140
|
+
* 2. Imports the wallet's public key and derives a shared secret
|
|
141
|
+
* 3. Creates a MessageChannel for private communication
|
|
142
|
+
* 4. Sends a connection request with our public key via window.postMessage
|
|
143
|
+
* (this is the only public message - subsequent communication uses the private channel)
|
|
144
|
+
*
|
|
145
|
+
* @param walletExportedPublicKey - The wallet's ECDH public key in JWK format
|
|
146
|
+
*/
|
|
147
|
+
private async establishSecureChannel(walletExportedPublicKey: ExportedPublicKey): Promise<void> {
|
|
148
|
+
const keyPair = await generateKeyPair();
|
|
149
|
+
const exportedPublicKey = await exportPublicKey(keyPair.publicKey);
|
|
150
|
+
|
|
151
|
+
const walletPublicKey = await importPublicKey(walletExportedPublicKey);
|
|
152
|
+
this.sharedKey = await deriveSharedKey(keyPair.privateKey, walletPublicKey);
|
|
153
|
+
|
|
154
|
+
const channel = new MessageChannel();
|
|
155
|
+
this.port = channel.port1;
|
|
156
|
+
|
|
157
|
+
this.port.onmessage = async (event: MessageEvent<EncryptedPayload>) => {
|
|
158
|
+
await this.handleEncryptedResponse(event.data);
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
this.port.start();
|
|
162
|
+
|
|
163
|
+
// Send connection request with our public key and transfer port2 to content script
|
|
164
|
+
// This is the only public postMessage - it contains our public key (safe to expose)
|
|
165
|
+
// and transfers the MessagePort for subsequent private communication
|
|
166
|
+
const connectRequest: ConnectRequest = {
|
|
167
|
+
type: 'aztec-wallet-connect',
|
|
168
|
+
walletId: this.extensionId,
|
|
169
|
+
appId: this.appId,
|
|
170
|
+
publicKey: exportedPublicKey,
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
window.postMessage(jsonStringify(connectRequest), '*', [channel.port2]);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Handles an encrypted response received from the wallet extension.
|
|
178
|
+
*
|
|
179
|
+
* Decrypts the response using the shared AES key and resolves or rejects
|
|
180
|
+
* the corresponding pending promise based on the response content.
|
|
181
|
+
*
|
|
182
|
+
* @param encrypted - The encrypted response from the wallet
|
|
183
|
+
*/
|
|
184
|
+
private async handleEncryptedResponse(encrypted: EncryptedPayload): Promise<void> {
|
|
185
|
+
if (!this.sharedKey) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
try {
|
|
190
|
+
const response = await decrypt<WalletResponse>(this.sharedKey, encrypted);
|
|
191
|
+
|
|
192
|
+
const { messageId, result, error, walletId: responseWalletId } = response;
|
|
66
193
|
|
|
67
194
|
if (!messageId || !responseWalletId) {
|
|
68
195
|
return;
|
|
69
196
|
}
|
|
70
197
|
|
|
71
|
-
if (
|
|
198
|
+
if (this.extensionId !== responseWalletId) {
|
|
72
199
|
return;
|
|
73
200
|
}
|
|
74
201
|
|
|
75
|
-
if (!
|
|
202
|
+
if (!this.inFlight.has(messageId)) {
|
|
76
203
|
return;
|
|
77
204
|
}
|
|
78
205
|
|
|
79
|
-
const { resolve, reject } =
|
|
206
|
+
const { resolve, reject } = this.inFlight.get(messageId)!;
|
|
80
207
|
|
|
81
208
|
if (error) {
|
|
82
209
|
reject(new Error(jsonStringify(error)));
|
|
83
210
|
} else {
|
|
84
211
|
resolve(result);
|
|
85
212
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
// Create a Proxy that intercepts wallet method calls and forwards them to the extension
|
|
90
|
-
return new Proxy(wallet, {
|
|
91
|
-
get: (target, prop) => {
|
|
92
|
-
if (schemaHasMethod(WalletSchema, prop.toString())) {
|
|
93
|
-
return async (...args: unknown[]) => {
|
|
94
|
-
const result = await target.postMessage({
|
|
95
|
-
type: prop.toString() as keyof FunctionsOf<Wallet>,
|
|
96
|
-
args,
|
|
97
|
-
});
|
|
98
|
-
return WalletSchema[prop.toString() as keyof typeof WalletSchema].returnType().parseAsync(result);
|
|
99
|
-
};
|
|
100
|
-
} else {
|
|
101
|
-
return target[prop as keyof ExtensionWallet];
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
}) as unknown as Wallet;
|
|
213
|
+
this.inFlight.delete(messageId);
|
|
214
|
+
// eslint-disable-next-line no-empty
|
|
215
|
+
} catch {}
|
|
105
216
|
}
|
|
106
217
|
|
|
107
|
-
|
|
218
|
+
/**
|
|
219
|
+
* Sends an encrypted wallet method call over the secure MessageChannel.
|
|
220
|
+
*
|
|
221
|
+
* The message is encrypted using AES-256-GCM with the shared key derived
|
|
222
|
+
* during channel establishment. A unique message ID is generated to correlate
|
|
223
|
+
* the response.
|
|
224
|
+
*
|
|
225
|
+
* @param call - The wallet method call containing method name and arguments
|
|
226
|
+
* @returns A Promise that resolves with the decrypted result from the wallet
|
|
227
|
+
*
|
|
228
|
+
* @throws Error if the secure channel has not been established
|
|
229
|
+
*/
|
|
230
|
+
private async postMessage(call: WalletMethodCall): Promise<unknown> {
|
|
231
|
+
if (!this.port || !this.sharedKey) {
|
|
232
|
+
throw new Error('Secure channel not established');
|
|
233
|
+
}
|
|
234
|
+
|
|
108
235
|
const messageId = globalThis.crypto.randomUUID();
|
|
109
236
|
const message: WalletMessage = {
|
|
110
237
|
type: call.type,
|
|
@@ -115,10 +242,34 @@ export class ExtensionWallet {
|
|
|
115
242
|
walletId: this.extensionId,
|
|
116
243
|
};
|
|
117
244
|
|
|
118
|
-
|
|
245
|
+
// Encrypt the message and send over the private MessageChannel
|
|
246
|
+
const encrypted = await encrypt(this.sharedKey, message);
|
|
247
|
+
this.port.postMessage(encrypted);
|
|
119
248
|
|
|
120
249
|
const { promise, resolve, reject } = promiseWithResolvers<unknown>();
|
|
121
250
|
this.inFlight.set(messageId, { promise, resolve, reject });
|
|
122
251
|
return promise;
|
|
123
252
|
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Closes the secure channel and cleans up resources.
|
|
256
|
+
*
|
|
257
|
+
* After calling this method, the wallet instance can no longer be used.
|
|
258
|
+
* Any pending requests will not receive responses.
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* ```typescript
|
|
262
|
+
* const wallet = await ExtensionWallet.create(walletInfo, chainInfo, 'my-app');
|
|
263
|
+
* // ... use wallet ...
|
|
264
|
+
* wallet.close(); // Clean up when done
|
|
265
|
+
* ```
|
|
266
|
+
*/
|
|
267
|
+
close(): void {
|
|
268
|
+
if (this.port) {
|
|
269
|
+
this.port.close();
|
|
270
|
+
this.port = null;
|
|
271
|
+
}
|
|
272
|
+
this.sharedKey = null;
|
|
273
|
+
this.inFlight.clear();
|
|
274
|
+
}
|
|
124
275
|
}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
export { ExtensionWallet } from './extension_wallet.js';
|
|
2
2
|
export { ExtensionProvider } from './extension_provider.js';
|
|
3
|
-
export
|
|
3
|
+
export * from '../../crypto.js';
|
|
4
|
+
export type {
|
|
5
|
+
WalletInfo,
|
|
6
|
+
WalletMessage,
|
|
7
|
+
WalletResponse,
|
|
8
|
+
DiscoveryRequest,
|
|
9
|
+
DiscoveryResponse,
|
|
10
|
+
ConnectRequest,
|
|
11
|
+
} from '../../types.js';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { ChainInfo } from '@aztec/aztec.js/account';
|
|
2
2
|
|
|
3
|
+
import type { ExportedPublicKey } from './crypto.js';
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
|
-
* Information about an installed Aztec wallet
|
|
6
|
+
* Information about an installed Aztec wallet
|
|
5
7
|
*/
|
|
6
8
|
export interface WalletInfo {
|
|
7
9
|
/** Unique identifier for the wallet */
|
|
@@ -12,10 +14,12 @@ export interface WalletInfo {
|
|
|
12
14
|
icon?: string;
|
|
13
15
|
/** Wallet version */
|
|
14
16
|
version: string;
|
|
17
|
+
/** Wallet's ECDH public key for secure channel establishment */
|
|
18
|
+
publicKey: ExportedPublicKey;
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
/**
|
|
18
|
-
* Message format for wallet communication
|
|
22
|
+
* Message format for wallet communication (internal, before encryption)
|
|
19
23
|
*/
|
|
20
24
|
export interface WalletMessage {
|
|
21
25
|
/** Unique message ID for tracking responses */
|
|
@@ -47,7 +51,7 @@ export interface WalletResponse {
|
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
/**
|
|
50
|
-
* Discovery message for finding installed wallets
|
|
54
|
+
* Discovery message for finding installed wallets (public, unencrypted)
|
|
51
55
|
*/
|
|
52
56
|
export interface DiscoveryRequest {
|
|
53
57
|
/** Message type for discovery */
|
|
@@ -59,7 +63,7 @@ export interface DiscoveryRequest {
|
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
/**
|
|
62
|
-
* Discovery response from
|
|
66
|
+
* Discovery response from a wallet (public, unencrypted)
|
|
63
67
|
*/
|
|
64
68
|
export interface DiscoveryResponse {
|
|
65
69
|
/** Message type for discovery response */
|
|
@@ -69,3 +73,17 @@ export interface DiscoveryResponse {
|
|
|
69
73
|
/** Wallet information */
|
|
70
74
|
walletInfo: WalletInfo;
|
|
71
75
|
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Connection request to establish secure channel
|
|
79
|
+
*/
|
|
80
|
+
export interface ConnectRequest {
|
|
81
|
+
/** Message type for connection */
|
|
82
|
+
type: 'aztec-wallet-connect';
|
|
83
|
+
/** Target wallet ID */
|
|
84
|
+
walletId: string;
|
|
85
|
+
/** Application ID */
|
|
86
|
+
appId: string;
|
|
87
|
+
/** dApp's ECDH public key for deriving shared secret */
|
|
88
|
+
publicKey: ExportedPublicKey;
|
|
89
|
+
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type { ChainInfo } from '@aztec/aztec.js/account';
|
|
2
|
-
/**
|
|
3
|
-
* Information about an installed Aztec wallet wallet
|
|
4
|
-
*/
|
|
5
|
-
export interface WalletInfo {
|
|
6
|
-
/** Unique identifier for the wallet */
|
|
7
|
-
id: string;
|
|
8
|
-
/** Display name of the wallet */
|
|
9
|
-
name: string;
|
|
10
|
-
/** URL to the wallet's icon */
|
|
11
|
-
icon?: string;
|
|
12
|
-
/** Wallet version */
|
|
13
|
-
version: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Message format for wallet communication
|
|
17
|
-
*/
|
|
18
|
-
export interface WalletMessage {
|
|
19
|
-
/** Unique message ID for tracking responses */
|
|
20
|
-
messageId: string;
|
|
21
|
-
/** The wallet method to call */
|
|
22
|
-
type: string;
|
|
23
|
-
/** Arguments for the method */
|
|
24
|
-
args: unknown[];
|
|
25
|
-
/** Chain information */
|
|
26
|
-
chainInfo: ChainInfo;
|
|
27
|
-
/** Application ID making the request */
|
|
28
|
-
appId: string;
|
|
29
|
-
/** Wallet ID to target a specific wallet */
|
|
30
|
-
walletId: string;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Response message from wallet
|
|
34
|
-
*/
|
|
35
|
-
export interface WalletResponse {
|
|
36
|
-
/** Message ID matching the request */
|
|
37
|
-
messageId: string;
|
|
38
|
-
/** Result data (if successful) */
|
|
39
|
-
result?: unknown;
|
|
40
|
-
/** Error data (if failed) */
|
|
41
|
-
error?: unknown;
|
|
42
|
-
/** Wallet ID that sent the response */
|
|
43
|
-
walletId: string;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Discovery message for finding installed wallets
|
|
47
|
-
*/
|
|
48
|
-
export interface DiscoveryRequest {
|
|
49
|
-
/** Message type for discovery */
|
|
50
|
-
type: 'aztec-wallet-discovery';
|
|
51
|
-
/** Request ID */
|
|
52
|
-
requestId: string;
|
|
53
|
-
/** Chain information to check if wallet supports this network */
|
|
54
|
-
chainInfo: ChainInfo;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Discovery response from an wallet
|
|
58
|
-
*/
|
|
59
|
-
export interface DiscoveryResponse {
|
|
60
|
-
/** Message type for discovery response */
|
|
61
|
-
type: 'aztec-wallet-discovery-response';
|
|
62
|
-
/** Request ID matching the discovery request */
|
|
63
|
-
requestId: string;
|
|
64
|
-
/** Wallet information */
|
|
65
|
-
walletInfo: WalletInfo;
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wcm92aWRlcnMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFFekQ7O0dBRUc7QUFDSCxNQUFNLFdBQVcsVUFBVTtJQUN6Qix1Q0FBdUM7SUFDdkMsRUFBRSxFQUFFLE1BQU0sQ0FBQztJQUNYLGlDQUFpQztJQUNqQyxJQUFJLEVBQUUsTUFBTSxDQUFDO0lBQ2IsK0JBQStCO0lBQy9CLElBQUksQ0FBQyxFQUFFLE1BQU0sQ0FBQztJQUNkLHFCQUFxQjtJQUNyQixPQUFPLEVBQUUsTUFBTSxDQUFDO0NBQ2pCO0FBRUQ7O0dBRUc7QUFDSCxNQUFNLFdBQVcsYUFBYTtJQUM1QiwrQ0FBK0M7SUFDL0MsU0FBUyxFQUFFLE1BQU0sQ0FBQztJQUNsQixnQ0FBZ0M7SUFDaEMsSUFBSSxFQUFFLE1BQU0sQ0FBQztJQUNiLCtCQUErQjtJQUMvQixJQUFJLEVBQUUsT0FBTyxFQUFFLENBQUM7SUFDaEIsd0JBQXdCO0lBQ3hCLF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