@aztec/wallet-sdk 0.0.1-commit.7d4e6cd → 0.0.1-commit.9372f48
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 +218 -355
- package/dest/base-wallet/base_wallet.d.ts +33 -10
- package/dest/base-wallet/base_wallet.d.ts.map +1 -1
- package/dest/base-wallet/base_wallet.js +53 -16
- package/dest/crypto.d.ts +73 -27
- package/dest/crypto.d.ts.map +1 -1
- package/dest/crypto.js +219 -41
- package/dest/emoji_alphabet.d.ts +35 -0
- package/dest/emoji_alphabet.d.ts.map +1 -0
- package/dest/emoji_alphabet.js +299 -0
- package/dest/extension/handlers/background_connection_handler.d.ts +158 -0
- package/dest/extension/handlers/background_connection_handler.d.ts.map +1 -0
- package/dest/extension/handlers/background_connection_handler.js +258 -0
- package/dest/extension/handlers/content_script_connection_handler.d.ts +56 -0
- package/dest/extension/handlers/content_script_connection_handler.d.ts.map +1 -0
- package/dest/extension/handlers/content_script_connection_handler.js +174 -0
- package/dest/extension/handlers/index.d.ts +12 -0
- package/dest/extension/handlers/index.d.ts.map +1 -0
- package/dest/extension/handlers/index.js +10 -0
- package/dest/extension/handlers/internal_message_types.d.ts +63 -0
- package/dest/extension/handlers/internal_message_types.d.ts.map +1 -0
- package/dest/extension/handlers/internal_message_types.js +22 -0
- package/dest/extension/provider/extension_provider.d.ts +107 -0
- package/dest/extension/provider/extension_provider.d.ts.map +1 -0
- package/dest/extension/provider/extension_provider.js +160 -0
- package/dest/extension/provider/extension_wallet.d.ts +131 -0
- package/dest/extension/provider/extension_wallet.d.ts.map +1 -0
- package/dest/extension/provider/extension_wallet.js +271 -0
- package/dest/extension/provider/index.d.ts +3 -0
- package/dest/extension/provider/index.d.ts.map +1 -0
- package/dest/{providers/extension → extension/provider}/index.js +0 -1
- package/dest/manager/index.d.ts +2 -7
- package/dest/manager/index.d.ts.map +1 -1
- package/dest/manager/index.js +0 -4
- package/dest/manager/types.d.ts +108 -5
- package/dest/manager/types.d.ts.map +1 -1
- package/dest/manager/types.js +17 -1
- package/dest/manager/wallet_manager.d.ts +50 -7
- package/dest/manager/wallet_manager.d.ts.map +1 -1
- package/dest/manager/wallet_manager.js +178 -29
- package/dest/types.d.ts +55 -15
- package/dest/types.d.ts.map +1 -1
- package/dest/types.js +10 -2
- package/package.json +11 -10
- package/src/base-wallet/base_wallet.ts +74 -28
- package/src/crypto.ts +263 -47
- package/src/emoji_alphabet.ts +317 -0
- package/src/extension/handlers/background_connection_handler.ts +423 -0
- package/src/extension/handlers/content_script_connection_handler.ts +246 -0
- package/src/extension/handlers/index.ts +25 -0
- package/src/extension/handlers/internal_message_types.ts +69 -0
- package/src/extension/provider/extension_provider.ts +233 -0
- package/src/extension/provider/extension_wallet.ts +321 -0
- package/src/extension/provider/index.ts +7 -0
- package/src/manager/index.ts +3 -9
- package/src/manager/types.ts +112 -4
- package/src/manager/wallet_manager.ts +204 -31
- package/src/types.ts +57 -14
- package/dest/providers/extension/extension_provider.d.ts +0 -17
- package/dest/providers/extension/extension_provider.d.ts.map +0 -1
- package/dest/providers/extension/extension_provider.js +0 -56
- package/dest/providers/extension/extension_wallet.d.ts +0 -95
- package/dest/providers/extension/extension_wallet.d.ts.map +0 -1
- package/dest/providers/extension/extension_wallet.js +0 -225
- package/dest/providers/extension/index.d.ts +0 -5
- package/dest/providers/extension/index.d.ts.map +0 -1
- package/src/providers/extension/extension_provider.ts +0 -72
- package/src/providers/extension/extension_wallet.ts +0 -275
- package/src/providers/extension/index.ts +0 -11
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-safe exports for extension background and content scripts.
|
|
3
|
+
*
|
|
4
|
+
* This module contains ONLY handlers that work in service worker/content script
|
|
5
|
+
* environments without Node.js polyfills.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/ export { BackgroundConnectionHandler } from './background_connection_handler.js';
|
|
9
|
+
export { ContentScriptConnectionHandler } from './content_script_connection_handler.js';
|
|
10
|
+
export { MessageOrigin } from './internal_message_types.js';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal message types for content script ↔ background communication.
|
|
3
|
+
* These are NOT part of the public wallet protocol - they are implementation
|
|
4
|
+
* details for coordinating between extension components.
|
|
5
|
+
*/
|
|
6
|
+
export declare const InternalMessageType: {
|
|
7
|
+
readonly DISCOVERY_REQUEST: "discovery-request";
|
|
8
|
+
readonly KEY_EXCHANGE_REQUEST: "key-exchange-request";
|
|
9
|
+
readonly SECURE_MESSAGE: "secure-message";
|
|
10
|
+
readonly DISCONNECT_REQUEST: "disconnect-request";
|
|
11
|
+
readonly DISCOVERY_APPROVED: "discovery-approved";
|
|
12
|
+
readonly KEY_EXCHANGE_RESPONSE: "key-exchange-response";
|
|
13
|
+
readonly SECURE_RESPONSE: "secure-response";
|
|
14
|
+
readonly SESSION_DISCONNECTED: "session-disconnected";
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Message origins for internal extension communication.
|
|
18
|
+
*/
|
|
19
|
+
export declare const MessageOrigin: {
|
|
20
|
+
readonly BACKGROUND: "background";
|
|
21
|
+
readonly CONTENT_SCRIPT: "content-script";
|
|
22
|
+
};
|
|
23
|
+
/** Union type of message origins. */
|
|
24
|
+
export type MessageOriginType = (typeof MessageOrigin)[keyof typeof MessageOrigin];
|
|
25
|
+
/**
|
|
26
|
+
* Message sent from content script to background.
|
|
27
|
+
*/
|
|
28
|
+
export interface ContentScriptMessage {
|
|
29
|
+
/** Message source identifier. */
|
|
30
|
+
origin: typeof MessageOrigin.CONTENT_SCRIPT;
|
|
31
|
+
/** Message type. */
|
|
32
|
+
type: string;
|
|
33
|
+
/** Optional session identifier. */
|
|
34
|
+
sessionId?: string;
|
|
35
|
+
/** Optional message payload. */
|
|
36
|
+
content?: unknown;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Message sent from background to content script.
|
|
40
|
+
*/
|
|
41
|
+
export interface BackgroundMessage {
|
|
42
|
+
/** Message source identifier. */
|
|
43
|
+
origin: typeof MessageOrigin.BACKGROUND;
|
|
44
|
+
/** Message type. */
|
|
45
|
+
type: string;
|
|
46
|
+
/** Session identifier. */
|
|
47
|
+
sessionId: string;
|
|
48
|
+
/** Optional message payload. */
|
|
49
|
+
content?: unknown;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Sender information for messages from browser runtime.
|
|
53
|
+
*/
|
|
54
|
+
export interface MessageSender {
|
|
55
|
+
/** Tab information if available. */
|
|
56
|
+
tab?: {
|
|
57
|
+
/** Tab identifier. */
|
|
58
|
+
id?: number;
|
|
59
|
+
/** Tab URL. */
|
|
60
|
+
url?: string;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJuYWxfbWVzc2FnZV90eXBlcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2V4dGVuc2lvbi9oYW5kbGVycy9pbnRlcm5hbF9tZXNzYWdlX3R5cGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7O0dBSUc7QUFDSCxlQUFPLE1BQU0sbUJBQW1COzs7Ozs7Ozs7Q0FXdEIsQ0FBQztBQUVYOztHQUVHO0FBQ0gsZUFBTyxNQUFNLGFBQWE7OztDQUdoQixDQUFDO0FBRVgscUNBQXFDO0FBQ3JDLE1BQU0sTUFBTSxpQkFBaUIsR0FBRyxDQUFDLE9BQU8sYUFBYSxDQUFDLENBQUMsTUFBTSxPQUFPLGFBQWEsQ0FBQyxDQUFDO0FBRW5GOztHQUVHO0FBQ0gsTUFBTSxXQUFXLG9CQUFvQjtJQUNuQyxpQ0FBaUM7SUFDakMsTUFBTSxFQUFFLE9BQU8sYUFBYSxDQUFDLGNBQWMsQ0FBQztJQUM1QyxvQkFBb0I7SUFDcEIsSUFBSSxFQUFFLE1BQU0sQ0FBQztJQUNiLG1DQUFtQztJQUNuQyxTQUFTLENBQUMsRUFBRSxNQUFNLENBQUM7SUFDbkIsZ0NBQWdDO0lBQ2hDLE9BQU8sQ0FBQyxFQUFFLE9BQU8sQ0FBQztDQUNuQjtBQUVEOztHQUVHO0FBQ0gsTUFBTSxXQUFXLGlCQUFpQjtJQUNoQyxpQ0FBaUM7SUFDakMsTUFBTSxFQUFFLE9BQU8sYUFBYSxDQUFDLFVBQVUsQ0FBQztJQUN4QyxvQkFBb0I7SUFDcEIsSUFBSSxFQUFFLE1BQU0sQ0FBQztJQUNiLDBCQUEwQjtJQUMxQixTQUFTLEVBQUUsTUFBTSxDQUFDO0lBQ2xCLGdDQUFnQztJQUNoQyxPQUFPLENBQUMsRUFBRSxPQUFPLENBQUM7Q0FDbkI7QUFFRDs7R0FFRztBQUNILE1BQU0sV0FBVyxhQUFhO0lBQzVCLG9DQUFvQztJQUNwQyxHQUFHLENBQUMsRUFBRTtRQUNKLHNCQUFzQjtRQUN0QixFQUFFLENBQUMsRUFBRSxNQUFNLENBQUM7UUFDWixlQUFlO1FBQ2YsR0FBRyxDQUFDLEVBQUUsTUFBTSxDQUFDO0tBQ2QsQ0FBQztDQUNIIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal_message_types.d.ts","sourceRoot":"","sources":["../../../src/extension/handlers/internal_message_types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;CAWtB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,aAAa;;;CAGhB,CAAC;AAEX,qCAAqC;AACrC,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAEnF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,iCAAiC;IACjC,MAAM,EAAE,OAAO,aAAa,CAAC,cAAc,CAAC;IAC5C,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,iCAAiC;IACjC,MAAM,EAAE,OAAO,aAAa,CAAC,UAAU,CAAC;IACxC,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,oCAAoC;IACpC,GAAG,CAAC,EAAE;QACJ,sBAAsB;QACtB,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,eAAe;QACf,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;CACH"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal message types for content script ↔ background communication.
|
|
3
|
+
* These are NOT part of the public wallet protocol - they are implementation
|
|
4
|
+
* details for coordinating between extension components.
|
|
5
|
+
*/ export const InternalMessageType = {
|
|
6
|
+
// Content script → Background
|
|
7
|
+
DISCOVERY_REQUEST: 'discovery-request',
|
|
8
|
+
KEY_EXCHANGE_REQUEST: 'key-exchange-request',
|
|
9
|
+
SECURE_MESSAGE: 'secure-message',
|
|
10
|
+
DISCONNECT_REQUEST: 'disconnect-request',
|
|
11
|
+
// Background → Content script
|
|
12
|
+
DISCOVERY_APPROVED: 'discovery-approved',
|
|
13
|
+
KEY_EXCHANGE_RESPONSE: 'key-exchange-response',
|
|
14
|
+
SECURE_RESPONSE: 'secure-response',
|
|
15
|
+
SESSION_DISCONNECTED: 'session-disconnected'
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Message origins for internal extension communication.
|
|
19
|
+
*/ export const MessageOrigin = {
|
|
20
|
+
BACKGROUND: 'background',
|
|
21
|
+
CONTENT_SCRIPT: 'content-script'
|
|
22
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { ChainInfo } from '@aztec/aztec.js/account';
|
|
2
|
+
import { type ConnectedWalletInfo, type WalletInfo } from '../../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* A discovered wallet before key exchange.
|
|
5
|
+
* Has basic info and MessagePort, but no shared key yet.
|
|
6
|
+
*
|
|
7
|
+
* Call {@link establishSecureChannel} to perform key exchange and get a connected wallet.
|
|
8
|
+
*/
|
|
9
|
+
export declare class DiscoveredWallet {
|
|
10
|
+
/** Basic wallet information (id, name, icon, version) */
|
|
11
|
+
readonly info: WalletInfo;
|
|
12
|
+
/** The MessagePort for private communication with the wallet */
|
|
13
|
+
readonly port: MessagePort;
|
|
14
|
+
/** Request ID for correlation */
|
|
15
|
+
readonly requestId: string;
|
|
16
|
+
constructor(
|
|
17
|
+
/** Basic wallet information (id, name, icon, version) */
|
|
18
|
+
info: WalletInfo,
|
|
19
|
+
/** The MessagePort for private communication with the wallet */
|
|
20
|
+
port: MessagePort,
|
|
21
|
+
/** Request ID for correlation */
|
|
22
|
+
requestId: string);
|
|
23
|
+
/**
|
|
24
|
+
* Establishes a secure connection with this wallet.
|
|
25
|
+
*
|
|
26
|
+
* This method:
|
|
27
|
+
* 1. Generates an ECDH key pair
|
|
28
|
+
* 2. Sends public key to wallet over the MessagePort
|
|
29
|
+
* 3. Receives wallet's public key
|
|
30
|
+
* 4. Derives shared secret and computes verification hash locally
|
|
31
|
+
*
|
|
32
|
+
* **IMPORTANT**: Has a 2 second timeout for MITM defense.
|
|
33
|
+
* Both parties must exchange keys relatively quickly.
|
|
34
|
+
*
|
|
35
|
+
* The verification hash is computed independently by both parties
|
|
36
|
+
* and should be displayed to the user for visual comparison.
|
|
37
|
+
*
|
|
38
|
+
* @returns Connected wallet with shared key and verification hash
|
|
39
|
+
* @throws Error if key exchange fails or times out
|
|
40
|
+
*/
|
|
41
|
+
establishSecureChannel(): Promise<ConnectedWallet>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A fully connected wallet with secure channel established.
|
|
45
|
+
* Available after key exchange completes.
|
|
46
|
+
*/
|
|
47
|
+
export interface ConnectedWallet {
|
|
48
|
+
/** Full wallet info including public key and verification hash */
|
|
49
|
+
info: ConnectedWalletInfo;
|
|
50
|
+
/** The MessagePort for encrypted communication */
|
|
51
|
+
port: MessagePort;
|
|
52
|
+
/** The derived AES-256-GCM shared key for encryption */
|
|
53
|
+
sharedKey: CryptoKey;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Options for wallet discovery.
|
|
57
|
+
*/
|
|
58
|
+
export interface DiscoveryOptions {
|
|
59
|
+
/** Application ID making the request */
|
|
60
|
+
appId: string;
|
|
61
|
+
/** How long to wait for user approval (ms). Default: 60000 (60s) */
|
|
62
|
+
timeout?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Callback invoked when a wallet is discovered.
|
|
65
|
+
* Wallets are streamed as users approve them.
|
|
66
|
+
*/
|
|
67
|
+
onWalletDiscovered?: (wallet: DiscoveredWallet) => void;
|
|
68
|
+
/**
|
|
69
|
+
* AbortSignal for cancelling discovery early.
|
|
70
|
+
* When aborted, cleanup happens immediately instead of waiting for timeout.
|
|
71
|
+
*/
|
|
72
|
+
signal?: AbortSignal;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Provider for discovering Aztec wallet extensions.
|
|
76
|
+
*
|
|
77
|
+
* NOTE: Most users should use WalletManager instead of this class directly.
|
|
78
|
+
* WalletManager provides a higher-level API with streaming support.
|
|
79
|
+
*
|
|
80
|
+
* The connection flow is split into two phases for security:
|
|
81
|
+
*
|
|
82
|
+
* 1. **Discovery Phase** ({@link discoverWallets}):
|
|
83
|
+
* - Broadcasts a discovery request (NO public keys)
|
|
84
|
+
* - Wallet shows pending request to user
|
|
85
|
+
* - User must approve before wallet reveals itself
|
|
86
|
+
* - Wallets are streamed via callback as they're approved
|
|
87
|
+
*
|
|
88
|
+
* 2. **Secure Channel Phase** ({@link DiscoveredWallet.establishSecureChannel}):
|
|
89
|
+
* - Performs ECDH key exchange over private MessageChannel
|
|
90
|
+
* - Both parties compute verification hash locally
|
|
91
|
+
* - Has a 2s timeout for MITM defense
|
|
92
|
+
* - Returns connected wallet with shared key and verification hash
|
|
93
|
+
*/
|
|
94
|
+
export declare class ExtensionProvider {
|
|
95
|
+
/**
|
|
96
|
+
* Discovers wallet extensions that user has approved.
|
|
97
|
+
*
|
|
98
|
+
* Wallets are streamed via the `onWalletDiscovered` callback as users approve them.
|
|
99
|
+
* The promise resolves when the timeout expires or signal is aborted.
|
|
100
|
+
*
|
|
101
|
+
* @param chainInfo - Chain information to check if extensions support this network
|
|
102
|
+
* @param options - Discovery options including appId, appName, timeout, and callback
|
|
103
|
+
* @returns Promise that resolves when discovery completes
|
|
104
|
+
*/
|
|
105
|
+
static discoverWallets(chainInfo: ChainInfo, options: DiscoveryOptions): Promise<void>;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXh0ZW5zaW9uX3Byb3ZpZGVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvZXh0ZW5zaW9uL3Byb3ZpZGVyL2V4dGVuc2lvbl9wcm92aWRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUt6RCxPQUFPLEVBQ0wsS0FBSyxtQkFBbUIsRUFLeEIsS0FBSyxVQUFVLEVBRWhCLE1BQU0sZ0JBQWdCLENBQUM7QUFReEI7Ozs7O0dBS0c7QUFDSCxxQkFBYSxnQkFBZ0I7SUFFekIseURBQXlEO2FBQ3pDLElBQUksRUFBRSxVQUFVO0lBQ2hDLGd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FnQixHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0E4RHJGO0NBQ0YifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension_provider.d.ts","sourceRoot":"","sources":["../../../src/extension/provider/extension_provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKzD,OAAO,EACL,KAAK,mBAAmB,EAKxB,KAAK,UAAU,EAEhB,MAAM,gBAAgB,CAAC;AAQxB;;;;;GAKG;AACH,qBAAa,gBAAgB;IAEzB,yDAAyD;aACzC,IAAI,EAAE,UAAU;IAChC,gEAAgE;aAChD,IAAI,EAAE,WAAW;IACjC,iCAAiC;aACjB,SAAS,EAAE,MAAM;IANnC;IACE,yDAAyD;IACzC,IAAI,EAAE,UAAU;IAChC,gEAAgE;IAChD,IAAI,EAAE,WAAW;IACjC,iCAAiC;IACjB,SAAS,EAAE,MAAM,EAC/B;IAEJ;;;;;;;;;;;;;;;;;OAiBG;IACG,sBAAsB,IAAI,OAAO,CAAC,eAAe,CAAC,CA+CvD;CACF;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,IAAI,EAAE,mBAAmB,CAAC;IAC1B,kDAAkD;IAClD,IAAI,EAAE,WAAW,CAAC;IAClB,wDAAwD;IACxD,SAAS,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACxD;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,iBAAiB;IAC5B;;;;;;;;;OASG;IACH,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8DrF;CACF"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
2
|
+
import { promiseWithResolvers } from '@aztec/foundation/promise';
|
|
3
|
+
import { deriveSessionKeys, exportPublicKey, generateKeyPair, importPublicKey } from '../../crypto.js';
|
|
4
|
+
import { WalletMessageType } from '../../types.js';
|
|
5
|
+
/** Default discovery timeout - long to give users time to approve */ const DEFAULT_DISCOVERY_TIMEOUT_MS = 60000; // 60 seconds
|
|
6
|
+
/** Key exchange timeout - short, wallet should respond quickly after discovery approval */ const KEY_EXCHANGE_TIMEOUT_MS = 2000; // 2 seconds
|
|
7
|
+
/**
|
|
8
|
+
* A discovered wallet before key exchange.
|
|
9
|
+
* Has basic info and MessagePort, but no shared key yet.
|
|
10
|
+
*
|
|
11
|
+
* Call {@link establishSecureChannel} to perform key exchange and get a connected wallet.
|
|
12
|
+
*/ export class DiscoveredWallet {
|
|
13
|
+
info;
|
|
14
|
+
port;
|
|
15
|
+
requestId;
|
|
16
|
+
constructor(/** Basic wallet information (id, name, icon, version) */ info, /** The MessagePort for private communication with the wallet */ port, /** Request ID for correlation */ requestId){
|
|
17
|
+
this.info = info;
|
|
18
|
+
this.port = port;
|
|
19
|
+
this.requestId = requestId;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Establishes a secure connection with this wallet.
|
|
23
|
+
*
|
|
24
|
+
* This method:
|
|
25
|
+
* 1. Generates an ECDH key pair
|
|
26
|
+
* 2. Sends public key to wallet over the MessagePort
|
|
27
|
+
* 3. Receives wallet's public key
|
|
28
|
+
* 4. Derives shared secret and computes verification hash locally
|
|
29
|
+
*
|
|
30
|
+
* **IMPORTANT**: Has a 2 second timeout for MITM defense.
|
|
31
|
+
* Both parties must exchange keys relatively quickly.
|
|
32
|
+
*
|
|
33
|
+
* The verification hash is computed independently by both parties
|
|
34
|
+
* and should be displayed to the user for visual comparison.
|
|
35
|
+
*
|
|
36
|
+
* @returns Connected wallet with shared key and verification hash
|
|
37
|
+
* @throws Error if key exchange fails or times out
|
|
38
|
+
*/ async establishSecureChannel() {
|
|
39
|
+
const keyPair = await generateKeyPair();
|
|
40
|
+
const exportedPublicKey = await exportPublicKey(keyPair.publicKey);
|
|
41
|
+
const { promise, resolve, reject } = promiseWithResolvers();
|
|
42
|
+
const timeoutId = setTimeout(()=>{
|
|
43
|
+
reject(new Error('Key exchange timeout'));
|
|
44
|
+
}, KEY_EXCHANGE_TIMEOUT_MS);
|
|
45
|
+
this.port.onmessage = async (event)=>{
|
|
46
|
+
const data = event.data;
|
|
47
|
+
if (data.type === WalletMessageType.KEY_EXCHANGE_RESPONSE && data.requestId === this.requestId) {
|
|
48
|
+
clearTimeout(timeoutId);
|
|
49
|
+
try {
|
|
50
|
+
const walletPublicKey = await importPublicKey(data.publicKey);
|
|
51
|
+
const session = await deriveSessionKeys(keyPair, walletPublicKey, true);
|
|
52
|
+
const connectedInfo = {
|
|
53
|
+
...this.info,
|
|
54
|
+
publicKey: data.publicKey,
|
|
55
|
+
verificationHash: session.verificationHash
|
|
56
|
+
};
|
|
57
|
+
resolve({
|
|
58
|
+
info: connectedInfo,
|
|
59
|
+
port: this.port,
|
|
60
|
+
sharedKey: session.encryptionKey
|
|
61
|
+
});
|
|
62
|
+
} catch (err) {
|
|
63
|
+
reject(new Error(`Key exchange failed: ${err}`));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
this.port.start();
|
|
68
|
+
const keyExchangeRequest = {
|
|
69
|
+
type: WalletMessageType.KEY_EXCHANGE_REQUEST,
|
|
70
|
+
requestId: this.requestId,
|
|
71
|
+
publicKey: exportedPublicKey
|
|
72
|
+
};
|
|
73
|
+
this.port.postMessage(keyExchangeRequest);
|
|
74
|
+
return promise;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Provider for discovering Aztec wallet extensions.
|
|
79
|
+
*
|
|
80
|
+
* NOTE: Most users should use WalletManager instead of this class directly.
|
|
81
|
+
* WalletManager provides a higher-level API with streaming support.
|
|
82
|
+
*
|
|
83
|
+
* The connection flow is split into two phases for security:
|
|
84
|
+
*
|
|
85
|
+
* 1. **Discovery Phase** ({@link discoverWallets}):
|
|
86
|
+
* - Broadcasts a discovery request (NO public keys)
|
|
87
|
+
* - Wallet shows pending request to user
|
|
88
|
+
* - User must approve before wallet reveals itself
|
|
89
|
+
* - Wallets are streamed via callback as they're approved
|
|
90
|
+
*
|
|
91
|
+
* 2. **Secure Channel Phase** ({@link DiscoveredWallet.establishSecureChannel}):
|
|
92
|
+
* - Performs ECDH key exchange over private MessageChannel
|
|
93
|
+
* - Both parties compute verification hash locally
|
|
94
|
+
* - Has a 2s timeout for MITM defense
|
|
95
|
+
* - Returns connected wallet with shared key and verification hash
|
|
96
|
+
*/ export class ExtensionProvider {
|
|
97
|
+
/**
|
|
98
|
+
* Discovers wallet extensions that user has approved.
|
|
99
|
+
*
|
|
100
|
+
* Wallets are streamed via the `onWalletDiscovered` callback as users approve them.
|
|
101
|
+
* The promise resolves when the timeout expires or signal is aborted.
|
|
102
|
+
*
|
|
103
|
+
* @param chainInfo - Chain information to check if extensions support this network
|
|
104
|
+
* @param options - Discovery options including appId, appName, timeout, and callback
|
|
105
|
+
* @returns Promise that resolves when discovery completes
|
|
106
|
+
*/ static discoverWallets(chainInfo, options) {
|
|
107
|
+
if (options.signal?.aborted) {
|
|
108
|
+
return Promise.resolve();
|
|
109
|
+
}
|
|
110
|
+
const timeout = options.timeout ?? DEFAULT_DISCOVERY_TIMEOUT_MS;
|
|
111
|
+
return new Promise((resolve)=>{
|
|
112
|
+
const requestId = globalThis.crypto.randomUUID();
|
|
113
|
+
let timeoutId = null;
|
|
114
|
+
let completed = false;
|
|
115
|
+
const finish = ()=>{
|
|
116
|
+
if (completed) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
completed = true;
|
|
120
|
+
if (timeoutId !== null) {
|
|
121
|
+
clearTimeout(timeoutId);
|
|
122
|
+
}
|
|
123
|
+
window.removeEventListener('message', onMessage);
|
|
124
|
+
options.signal?.removeEventListener('abort', onAbort);
|
|
125
|
+
resolve();
|
|
126
|
+
};
|
|
127
|
+
const onAbort = ()=>finish();
|
|
128
|
+
const onMessage = (event)=>{
|
|
129
|
+
if (completed || event.source !== window) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
let data;
|
|
133
|
+
try {
|
|
134
|
+
data = JSON.parse(event.data);
|
|
135
|
+
} catch {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (data.type !== WalletMessageType.DISCOVERY_RESPONSE || data.requestId !== requestId) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const port = event.ports?.[0];
|
|
142
|
+
if (port) {
|
|
143
|
+
options.onWalletDiscovered?.(new DiscoveredWallet(data.walletInfo, port, requestId));
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
options.signal?.addEventListener('abort', onAbort, {
|
|
147
|
+
once: true
|
|
148
|
+
});
|
|
149
|
+
window.addEventListener('message', onMessage);
|
|
150
|
+
const discoveryMessage = {
|
|
151
|
+
type: WalletMessageType.DISCOVERY,
|
|
152
|
+
requestId,
|
|
153
|
+
appId: options.appId,
|
|
154
|
+
chainInfo
|
|
155
|
+
};
|
|
156
|
+
window.postMessage(jsonStringify(discoveryMessage), '*');
|
|
157
|
+
timeoutId = setTimeout(finish, timeout);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { ChainInfo } from '@aztec/aztec.js/account';
|
|
2
|
+
import { type Wallet } from '@aztec/aztec.js/wallet';
|
|
3
|
+
/**
|
|
4
|
+
* Callback type for wallet disconnect events.
|
|
5
|
+
*/
|
|
6
|
+
export type DisconnectCallback = () => void;
|
|
7
|
+
/**
|
|
8
|
+
* A wallet implementation that communicates with browser extension wallets
|
|
9
|
+
* using an encrypted MessageChannel.
|
|
10
|
+
*
|
|
11
|
+
* This class uses a secure channel established after discovery:
|
|
12
|
+
*
|
|
13
|
+
* 1. **MessageChannel**: Created during discovery and transferred via window.postMessage.
|
|
14
|
+
* Note: The port transfer is visible to page scripts, but security comes from encryption.
|
|
15
|
+
*
|
|
16
|
+
* 2. **ECDH Key Exchange**: The shared secret was derived after discovery using
|
|
17
|
+
* Elliptic Curve Diffie-Hellman key exchange over the MessagePort.
|
|
18
|
+
*
|
|
19
|
+
* 3. **AES-GCM Encryption**: All messages are encrypted using AES-256-GCM,
|
|
20
|
+
* providing both confidentiality and authenticity. This is what secures the channel.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* // Discover and establish secure channel to a wallet
|
|
25
|
+
* const discoveredWallets = await ExtensionProvider.discoverWallets(chainInfo, { appId: 'my-dapp' });
|
|
26
|
+
* const connection = await discoveredWallets[0].establishSecureChannel();
|
|
27
|
+
*
|
|
28
|
+
* // User can verify emoji if desired
|
|
29
|
+
* console.log('Verify:', hashToEmoji(connection.info.verificationHash!));
|
|
30
|
+
*
|
|
31
|
+
* // Create wallet using the connection
|
|
32
|
+
* const wallet = ExtensionWallet.create(connection.info.id, connection.port, connection.sharedKey, chainInfo, 'my-dapp');
|
|
33
|
+
*
|
|
34
|
+
* // All subsequent calls are encrypted
|
|
35
|
+
* const accounts = await wallet.getAccounts();
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare class ExtensionWallet {
|
|
39
|
+
private chainInfo;
|
|
40
|
+
private appId;
|
|
41
|
+
private extensionId;
|
|
42
|
+
private port;
|
|
43
|
+
private sharedKey;
|
|
44
|
+
/** Map of pending requests awaiting responses, keyed by message ID */
|
|
45
|
+
private inFlight;
|
|
46
|
+
private disconnected;
|
|
47
|
+
private disconnectCallbacks;
|
|
48
|
+
/**
|
|
49
|
+
* Private constructor - use {@link ExtensionWallet.create} to instantiate.
|
|
50
|
+
* @param chainInfo - The chain information (chainId and version)
|
|
51
|
+
* @param appId - Application identifier for the requesting dApp
|
|
52
|
+
* @param extensionId - The unique identifier of the target wallet extension
|
|
53
|
+
* @param port - The MessagePort for private communication with the wallet
|
|
54
|
+
* @param sharedKey - The derived AES-256-GCM shared key for encryption
|
|
55
|
+
*/
|
|
56
|
+
private constructor();
|
|
57
|
+
/**
|
|
58
|
+
* Creates a Wallet that communicates with a browser extension
|
|
59
|
+
* over a secure encrypted MessageChannel.
|
|
60
|
+
*
|
|
61
|
+
* @param extensionId - The unique identifier of the wallet extension
|
|
62
|
+
* @param port - The MessagePort for encrypted communication with the wallet
|
|
63
|
+
* @param sharedKey - The derived AES-256-GCM shared key for encryption
|
|
64
|
+
* @param chainInfo - The chain information (chainId and version) for request context
|
|
65
|
+
* @param appId - Application identifier used to identify the requesting dApp to the wallet
|
|
66
|
+
* @returns A Wallet interface where all method calls are encrypted
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* const discoveredWallets = await ExtensionProvider.discoverWallets(chainInfo, { appId: 'my-defi-app' });
|
|
71
|
+
* const connection = await discoveredWallets[0].establishSecureChannel();
|
|
72
|
+
* const wallet = ExtensionWallet.create(
|
|
73
|
+
* connection.info.id,
|
|
74
|
+
* connection.port,
|
|
75
|
+
* connection.sharedKey,
|
|
76
|
+
* chainInfo,
|
|
77
|
+
* 'my-defi-app'
|
|
78
|
+
* );
|
|
79
|
+
*
|
|
80
|
+
* const accounts = await wallet.getAccounts();
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
static create(extensionId: string, port: MessagePort, sharedKey: CryptoKey, chainInfo: ChainInfo, appId: string): Wallet;
|
|
84
|
+
private handleEncryptedResponse;
|
|
85
|
+
private postMessage;
|
|
86
|
+
/**
|
|
87
|
+
* Handles wallet disconnection.
|
|
88
|
+
* Rejects all pending requests and notifies registered callbacks.
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
private handleDisconnect;
|
|
92
|
+
/**
|
|
93
|
+
* Registers a callback to be invoked when the wallet disconnects.
|
|
94
|
+
*
|
|
95
|
+
* @param callback - Function to call when wallet disconnects
|
|
96
|
+
* @returns A function to unregister the callback
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* const wallet = await ExtensionWallet.create(...);
|
|
101
|
+
* const unsubscribe = wallet.onDisconnect(() => {
|
|
102
|
+
* console.log('Wallet disconnected! Please reconnect.');
|
|
103
|
+
* // Clean up UI, prompt user to reconnect, etc.
|
|
104
|
+
* });
|
|
105
|
+
* // Later: unsubscribe(); to stop receiving notifications
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
onDisconnect(callback: DisconnectCallback): () => void;
|
|
109
|
+
/**
|
|
110
|
+
* Returns whether the wallet has been disconnected.
|
|
111
|
+
*
|
|
112
|
+
* @returns true if the wallet is no longer connected
|
|
113
|
+
*/
|
|
114
|
+
isDisconnected(): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Disconnects from the wallet and cleans up resources.
|
|
117
|
+
*
|
|
118
|
+
* This method notifies the wallet extension that the session is ending,
|
|
119
|
+
* allowing it to clean up its state. After calling this method, the wallet
|
|
120
|
+
* instance can no longer be used and any pending requests will be rejected.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```typescript
|
|
124
|
+
* const extensionWallet = ExtensionWallet.create(extensionId, port, sharedKey, chainInfo, 'my-app');
|
|
125
|
+
* // ... use wallet ...
|
|
126
|
+
* await extensionWallet.disconnect(); // Clean disconnect when done
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
disconnect(): Promise<void>;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXh0ZW5zaW9uX3d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