@dynamic-labs-wallet/browser-wallet-client 0.0.0-beta-191.1

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/index.esm.js ADDED
@@ -0,0 +1,581 @@
1
+ import { parseMessageTransportData, createRequestChannel, applyDefaultMessageOrigin, createMessageTransport } from '@dynamic-labs/message-transport';
2
+ import { Logger } from '@dynamic-labs/logger';
3
+ import { WalletOperation, getEnvironmentFromUrl, IFRAME_DOMAIN_MAP } from '@dynamic-labs-wallet/core';
4
+ export { MPC_RELAY_PREPROD_API_URL, MPC_RELAY_PROD_API_URL, ThresholdSignatureScheme, WalletOperation } from '@dynamic-labs-wallet/core';
5
+
6
+ const setupMessageTransportBridge = (messageTransport, iframe, iframeOrigin)=>{
7
+ if (!(iframe == null ? void 0 : iframe.contentWindow)) {
8
+ throw new Error('Iframe or contentWindow not available');
9
+ }
10
+ const logger = new Logger('debug');
11
+ messageTransport.on((message)=>{
12
+ // Forward the message to webview via postMessage
13
+ if (message.origin === 'host') {
14
+ var _iframe_contentWindow;
15
+ iframe == null ? void 0 : (_iframe_contentWindow = iframe.contentWindow) == null ? void 0 : _iframe_contentWindow.postMessage(message, iframeOrigin);
16
+ }
17
+ });
18
+ const handleIncomingMessage = (message)=>{
19
+ const { data } = message;
20
+ if (!data) return;
21
+ if ((data == null ? void 0 : data.origin) !== 'webview') {
22
+ return;
23
+ }
24
+ if (typeof data !== 'object') {
25
+ return;
26
+ }
27
+ try {
28
+ const message = parseMessageTransportData(data);
29
+ messageTransport.emit(message);
30
+ } catch (error) {
31
+ if (!(error instanceof SyntaxError)) {
32
+ logger.error('Error handling incoming message:', error);
33
+ }
34
+ }
35
+ };
36
+ /**
37
+ * Handle incoming message from android client
38
+ */ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
39
+ // @ts-ignore
40
+ document.addEventListener('message', handleIncomingMessage);
41
+ /**
42
+ * Handle incoming message from iOS client
43
+ */ window.addEventListener('message', handleIncomingMessage);
44
+ };
45
+
46
+ class iframeMessageHandler {
47
+ async getWallets(request) {
48
+ return this.requestChannel.request('getWallets', request);
49
+ }
50
+ async getWallet({ chainName, accountAddress, walletOperation, signedSessionId }) {
51
+ return this.requestChannel.request('getWallet', {
52
+ chainName,
53
+ accountAddress,
54
+ walletOperation,
55
+ signedSessionId
56
+ });
57
+ }
58
+ async createWalletAccount(request) {
59
+ return this.requestChannel.request('createWalletAccount', request);
60
+ }
61
+ async requiresPasswordForOperation(request) {
62
+ return this.requestChannel.request('requiresPasswordForOperation', request);
63
+ }
64
+ async signMessage(request) {
65
+ return this.requestChannel.request('signMessage', request);
66
+ }
67
+ async signRawMessage(request) {
68
+ return this.requestChannel.request('signRawMessage', request);
69
+ }
70
+ async signTransaction(request) {
71
+ return this.requestChannel.request('signTransaction', request);
72
+ }
73
+ async isPasswordEncrypted(request) {
74
+ return this.requestChannel.request('isPasswordEncrypted', request);
75
+ }
76
+ async backupKeySharesToGoogleDrive(request) {
77
+ await this.requestChannel.request('backupKeySharesToGoogleDrive', request);
78
+ }
79
+ async restoreBackupFromGoogleDrive(request) {
80
+ return this.requestChannel.request('restoreBackupFromGoogleDrive', request);
81
+ }
82
+ async refreshWalletAccountShares(request) {
83
+ return this.requestChannel.request('refreshWalletAccountShares', request);
84
+ }
85
+ async reshare(request) {
86
+ return this.requestChannel.request('reshare', request);
87
+ }
88
+ async exportPrivateKey(request) {
89
+ return this.requestChannel.request('exportPrivateKey', request);
90
+ }
91
+ async verifyPassword(request) {
92
+ return this.requestChannel.request('verifyPassword', request);
93
+ }
94
+ async updatePassword(request) {
95
+ return this.requestChannel.request('updatePassword', request);
96
+ }
97
+ async importPrivateKey(request) {
98
+ return this.requestChannel.request('importPrivateKey', request);
99
+ }
100
+ async sendAuthToken(token) {
101
+ return this.requestChannel.request('sendAuthToken', token);
102
+ }
103
+ async exportClientKeyshares(request) {
104
+ return this.requestChannel.request('exportClientKeyshares', request);
105
+ }
106
+ async offlineExportPrivateKey(request) {
107
+ return this.requestChannel.request('offlineExportPrivateKey', request);
108
+ }
109
+ async cleanup() {
110
+ return this.requestChannel.request('cleanup');
111
+ }
112
+ constructor(messageTransport){
113
+ this.requestChannel = createRequestChannel(messageTransport);
114
+ }
115
+ }
116
+
117
+ const logger = new Logger('DynamicWaasWalletClient');
118
+
119
+ class DynamicWalletClient {
120
+ // Simply load the iframe from localhost
121
+ async initialize() {
122
+ await this.doInitializeIframeCommunication();
123
+ }
124
+ /**
125
+ * this is called on class construction time
126
+ * @returns {Promise<void>} that resolves when the iframe is loaded and the message transport and iframe storage are initialized
127
+ */ initializeIframeCommunication() {
128
+ if (!DynamicWalletClient.iframeLoadPromise) {
129
+ DynamicWalletClient.iframeLoadPromise = this.doInitializeIframeCommunication();
130
+ }
131
+ return DynamicWalletClient.iframeLoadPromise;
132
+ }
133
+ /**
134
+ * initialize the iframe communication by awaiting the iframe load promise
135
+ * and initializing the message transport and iframe storage after iframe is successfully loaded
136
+ */ async doInitializeIframeCommunication() {
137
+ try {
138
+ await this.loadIframe();
139
+ } catch (error) {
140
+ this.logger.error('Error initializing iframe:', error);
141
+ throw error;
142
+ }
143
+ }
144
+ /**
145
+ * initialize the message transport after iframe is successfully loaded
146
+ */ async initializeMessageTransport() {
147
+ await this.initializeIframeCommunication();
148
+ const transport = applyDefaultMessageOrigin({
149
+ defaultOrigin: 'host',
150
+ messageTransport: createMessageTransport()
151
+ });
152
+ this.messageTransport = transport;
153
+ if (!this.iframe) {
154
+ throw new Error('Iframe not available');
155
+ }
156
+ setupMessageTransportBridge(this.messageTransport, this.iframe, this.iframeDomain);
157
+ this.iframeMessageHandler = new iframeMessageHandler(this.messageTransport);
158
+ await this.initAuthToken();
159
+ }
160
+ /**
161
+ * securely exchange the auth token with iframe securely
162
+ */ async initAuthToken() {
163
+ if (!this.iframeMessageHandler) {
164
+ throw new Error('Iframe message handler not initialized');
165
+ }
166
+ try {
167
+ // Send auth token to iframe
168
+ await this.iframeMessageHandler.sendAuthToken(this.authToken);
169
+ } catch (error) {
170
+ throw new Error('Failed to establish secure token exchange: ' + error);
171
+ }
172
+ }
173
+ async loadIframe() {
174
+ // If the iframe is already loaded, just assign and resolve
175
+ if (DynamicWalletClient.sharedIframe) {
176
+ this.iframe = DynamicWalletClient.sharedIframe;
177
+ DynamicWalletClient.iframeInstanceCount++;
178
+ return Promise.resolve();
179
+ }
180
+ // If a load is in progress, wait for it, then assign
181
+ if (DynamicWalletClient.iframeLoadPromise) {
182
+ return DynamicWalletClient.iframeLoadPromise.then(()=>{
183
+ this.iframe = DynamicWalletClient.sharedIframe;
184
+ DynamicWalletClient.iframeInstanceCount++;
185
+ });
186
+ }
187
+ DynamicWalletClient.iframeLoadPromise = new Promise((resolve, reject)=>{
188
+ const iframe = document.createElement('iframe');
189
+ const iframeTimeoutId = setTimeout(()=>{
190
+ reject(new Error('Iframe load timeout'));
191
+ }, 10000);
192
+ iframe.style.display = 'none';
193
+ iframe.setAttribute('title', 'Dynamic Wallet Iframe');
194
+ iframe.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-downloads');
195
+ iframe.setAttribute('referrerpolicy', 'origin');
196
+ iframe.style.position = 'fixed';
197
+ iframe.style.top = '0';
198
+ iframe.style.left = '0';
199
+ iframe.style.width = '0';
200
+ iframe.style.height = '0';
201
+ iframe.style.border = 'none';
202
+ iframe.style.pointerEvents = 'none';
203
+ var _this_instanceId;
204
+ const params = new URLSearchParams({
205
+ instanceId: (_this_instanceId = this.instanceId) != null ? _this_instanceId : '',
206
+ hostOrigin: window.location.origin,
207
+ environmentId: this.environmentId,
208
+ baseApiUrl: this.baseApiUrl,
209
+ baseMPCRelayApiUrl: this.baseMPCRelayApiUrl
210
+ });
211
+ iframe.src = `${this.iframeDomain}/waas-v1/${this.environmentId}?${params.toString()}`;
212
+ this.logger.debug('Creating iframe with src:', iframe.src);
213
+ document.body.appendChild(iframe);
214
+ iframe.onload = ()=>{
215
+ clearTimeout(iframeTimeoutId);
216
+ DynamicWalletClient.sharedIframe = iframe;
217
+ this.iframe = iframe;
218
+ DynamicWalletClient.iframeInstanceCount++;
219
+ resolve();
220
+ };
221
+ iframe.onerror = (error)=>{
222
+ clearTimeout(iframeTimeoutId);
223
+ this.logger.error('Iframe failed to load:', error);
224
+ reject(new Error('Failed to load iframe'));
225
+ };
226
+ });
227
+ return DynamicWalletClient.iframeLoadPromise;
228
+ }
229
+ /**
230
+ * Load an iframe for a specific container
231
+ * @param {HTMLElement} container - The container to which the iframe will be attached
232
+ * @returns {Promise<HTMLIFrameElement>} that resolves when the iframe is loaded
233
+ */ loadIframeForContainer(container) {
234
+ return new Promise((resolve, reject)=>{
235
+ const iframe = document.createElement('iframe');
236
+ const iframeTimeoutId = setTimeout(()=>{
237
+ reject(new Error('Iframe load timeout'));
238
+ }, 10000);
239
+ iframe.style.display = 'block';
240
+ iframe.style.width = '100%';
241
+ iframe.style.height = '100%';
242
+ iframe.setAttribute('title', 'Dynamic Wallet Storage');
243
+ iframe.setAttribute('sandbox', 'allow-scripts allow-same-origin');
244
+ iframe.setAttribute('referrerpolicy', 'origin');
245
+ var _this_instanceId;
246
+ const params = new URLSearchParams({
247
+ instanceId: (_this_instanceId = this.instanceId) != null ? _this_instanceId : '',
248
+ hostOrigin: window.location.origin,
249
+ environmentId: this.environmentId,
250
+ baseApiUrl: this.baseApiUrl,
251
+ baseMPCRelayApiUrl: this.baseMPCRelayApiUrl,
252
+ chain: this.chainName
253
+ });
254
+ iframe.src = `${this.iframeDomain}/waas-v1/${this.environmentId}?${params.toString()}`;
255
+ this.logger.debug('Creating iframe with src:', iframe.src);
256
+ // Add iframe to the provided container
257
+ container.appendChild(iframe);
258
+ iframe.onload = ()=>{
259
+ clearTimeout(iframeTimeoutId);
260
+ this.logger.debug('Iframe loaded successfully');
261
+ resolve(iframe);
262
+ };
263
+ iframe.onerror = (error)=>{
264
+ clearTimeout(iframeTimeoutId);
265
+ this.logger.error('Iframe failed to load:', error);
266
+ reject(new Error('Failed to load iframe'));
267
+ };
268
+ });
269
+ }
270
+ /**
271
+ * Initializes the iframe display for a specific container.
272
+ *
273
+ * @param {HTMLElement} container - The container to which the iframe will be attached.
274
+ * @returns:
275
+ * iframe: HTMLIFrameElement;
276
+ * iframeDisplay: IframeDisplayChannelAdapter;
277
+ * cleanup: () => void;
278
+ */ async initializeIframeDisplayForContainer({ container }) {
279
+ try {
280
+ const iframe = await this.loadIframeForContainer(container);
281
+ const transport = applyDefaultMessageOrigin({
282
+ defaultOrigin: 'host',
283
+ messageTransport: createMessageTransport()
284
+ });
285
+ setupMessageTransportBridge(transport, iframe, this.iframeDomain);
286
+ const iframeDisplay = new iframeMessageHandler(transport);
287
+ // Send auth token to iframe
288
+ await iframeDisplay.sendAuthToken(this.authToken);
289
+ return {
290
+ iframe,
291
+ iframeDisplay,
292
+ cleanup: ()=>{
293
+ container.removeChild(iframe);
294
+ }
295
+ };
296
+ } catch (error) {
297
+ this.logger.error('Error initializing iframe:', error);
298
+ throw error;
299
+ }
300
+ }
301
+ async getWallets() {
302
+ await this.initializeMessageTransport();
303
+ if (!this.iframeMessageHandler) {
304
+ throw new Error('Iframe message handler not initialized');
305
+ }
306
+ return this.iframeMessageHandler.getWallets({
307
+ chainName: this.chainName
308
+ });
309
+ }
310
+ async getWallet({ accountAddress, walletOperation = WalletOperation.NO_OPERATION, signedSessionId }) {
311
+ await this.initializeMessageTransport();
312
+ if (!this.iframeMessageHandler) {
313
+ throw new Error('Iframe message handler not initialized');
314
+ }
315
+ return this.iframeMessageHandler.getWallet({
316
+ chainName: this.chainName,
317
+ accountAddress,
318
+ walletOperation,
319
+ signedSessionId
320
+ });
321
+ }
322
+ async createWalletAccount({ thresholdSignatureScheme, password = undefined, signedSessionId }) {
323
+ await this.initializeMessageTransport();
324
+ if (!this.iframeMessageHandler) {
325
+ throw new Error('Iframe message handler not initialized');
326
+ }
327
+ return this.iframeMessageHandler.createWalletAccount({
328
+ chainName: this.chainName,
329
+ thresholdSignatureScheme,
330
+ password,
331
+ signedSessionId
332
+ });
333
+ }
334
+ async requiresPasswordForOperation({ accountAddress, walletOperation = WalletOperation.REACH_THRESHOLD }) {
335
+ await this.initializeMessageTransport();
336
+ if (!this.iframeMessageHandler) {
337
+ throw new Error('Iframe message handler not initialized');
338
+ }
339
+ return this.iframeMessageHandler.requiresPasswordForOperation({
340
+ chainName: this.chainName,
341
+ accountAddress,
342
+ walletOperation
343
+ });
344
+ }
345
+ async isPasswordEncrypted({ accountAddress }) {
346
+ await this.initializeMessageTransport();
347
+ if (!this.iframeMessageHandler) {
348
+ throw new Error('Iframe message handler not initialized');
349
+ }
350
+ return this.iframeMessageHandler.isPasswordEncrypted({
351
+ chainName: this.chainName,
352
+ accountAddress
353
+ });
354
+ }
355
+ async signMessage({ message, accountAddress, password = undefined, signedSessionId }) {
356
+ await this.initializeMessageTransport();
357
+ if (!this.iframeMessageHandler) {
358
+ throw new Error('Iframe message handler not initialized');
359
+ }
360
+ return this.iframeMessageHandler.signMessage({
361
+ chainName: this.chainName,
362
+ message,
363
+ accountAddress,
364
+ password,
365
+ signedSessionId
366
+ });
367
+ }
368
+ async signRawMessage({ message, accountAddress, password = undefined, signedSessionId }) {
369
+ await this.initializeMessageTransport();
370
+ if (!this.iframeMessageHandler) {
371
+ throw new Error('Iframe message handler not initialized');
372
+ }
373
+ return this.iframeMessageHandler.signRawMessage({
374
+ chainName: this.chainName,
375
+ message,
376
+ accountAddress,
377
+ password,
378
+ signedSessionId
379
+ });
380
+ }
381
+ /**
382
+ * Signs a transaction and returns the signature, @transaction is a string of the serialized transaction
383
+ * EVM:
384
+ * transaction = serializeTransaction()
385
+ * SOL:
386
+ * const messageBytes = transaction.serializeMessage();
387
+ * const messageToSign = Buffer.from(messageBytes).toString("hex");
388
+ * SUI:
389
+ * const txBytes = await txb.build({ client });
390
+ * const txString = Buffer.from(txBytes).toString("hex");
391
+ */ async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId }) {
392
+ await this.initializeMessageTransport();
393
+ if (!this.iframeMessageHandler) {
394
+ throw new Error('Iframe message handler not initialized');
395
+ }
396
+ return this.iframeMessageHandler.signTransaction({
397
+ chainName: this.chainName,
398
+ senderAddress,
399
+ transaction,
400
+ password,
401
+ signedSessionId
402
+ });
403
+ }
404
+ async backupKeySharesToGoogleDrive({ accountAddress, password = undefined, signedSessionId }) {
405
+ await this.initializeMessageTransport();
406
+ if (!this.iframeMessageHandler) {
407
+ throw new Error('Iframe message handler not initialized');
408
+ }
409
+ return this.iframeMessageHandler.backupKeySharesToGoogleDrive({
410
+ chainName: this.chainName,
411
+ accountAddress,
412
+ password,
413
+ signedSessionId
414
+ });
415
+ }
416
+ async restoreBackupFromGoogleDrive({ accountAddress, displayContainer, password, signedSessionId }) {
417
+ const { iframeDisplay } = await this.initializeIframeDisplayForContainer({
418
+ container: displayContainer
419
+ });
420
+ if (!iframeDisplay) {
421
+ throw new Error('Failed to initialize iframe handler with display functionality');
422
+ }
423
+ return iframeDisplay.restoreBackupFromGoogleDrive({
424
+ chainName: this.chainName,
425
+ accountAddress,
426
+ password,
427
+ signedSessionId
428
+ });
429
+ }
430
+ async refreshWalletAccountShares({ accountAddress, password, signedSessionId }) {
431
+ await this.initializeMessageTransport();
432
+ if (!this.iframeMessageHandler) {
433
+ throw new Error('Iframe message handler not initialized');
434
+ }
435
+ return this.iframeMessageHandler.refreshWalletAccountShares({
436
+ chainName: this.chainName,
437
+ accountAddress: accountAddress,
438
+ password: password,
439
+ signedSessionId
440
+ });
441
+ }
442
+ async reshare({ accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password, signedSessionId }) {
443
+ await this.initializeMessageTransport();
444
+ if (!this.iframeMessageHandler) {
445
+ throw new Error('Iframe message handler not initialized');
446
+ }
447
+ return this.iframeMessageHandler.reshare({
448
+ chainName: this.chainName,
449
+ accountAddress,
450
+ oldThresholdSignatureScheme,
451
+ newThresholdSignatureScheme,
452
+ password,
453
+ signedSessionId
454
+ });
455
+ }
456
+ async exportPrivateKey({ accountAddress, displayContainer, password, signedSessionId }) {
457
+ const { iframeDisplay } = await this.initializeIframeDisplayForContainer({
458
+ container: displayContainer
459
+ });
460
+ if (!iframeDisplay) {
461
+ throw new Error('Failed to initialize iframe handler with display functionality');
462
+ }
463
+ return iframeDisplay.exportPrivateKey({
464
+ chainName: this.chainName,
465
+ accountAddress,
466
+ password,
467
+ signedSessionId
468
+ });
469
+ }
470
+ async verifyPassword({ accountAddress, password, walletOperation = WalletOperation.NO_OPERATION, signedSessionId }) {
471
+ await this.initializeMessageTransport();
472
+ if (!this.iframeMessageHandler) {
473
+ throw new Error('Iframe message handler not initialized');
474
+ }
475
+ return this.iframeMessageHandler.verifyPassword({
476
+ chainName: this.chainName,
477
+ accountAddress,
478
+ password,
479
+ walletOperation,
480
+ signedSessionId
481
+ });
482
+ }
483
+ async updatePassword({ accountAddress, existingPassword, newPassword, signedSessionId }) {
484
+ await this.initializeMessageTransport();
485
+ if (!this.iframeMessageHandler) {
486
+ throw new Error('Iframe message handler not initialized');
487
+ }
488
+ return this.iframeMessageHandler.updatePassword({
489
+ chainName: this.chainName,
490
+ accountAddress,
491
+ existingPassword,
492
+ newPassword,
493
+ signedSessionId
494
+ });
495
+ }
496
+ async importPrivateKey({ privateKey, thresholdSignatureScheme }) {
497
+ await this.initializeMessageTransport();
498
+ if (!this.iframeMessageHandler) {
499
+ throw new Error('Iframe message handler not initialized');
500
+ }
501
+ return this.iframeMessageHandler.importPrivateKey({
502
+ chainName: this.chainName,
503
+ privateKey,
504
+ thresholdSignatureScheme
505
+ });
506
+ }
507
+ async exportClientKeyshares({ accountAddress, password, signedSessionId }) {
508
+ await this.initializeMessageTransport();
509
+ if (!this.iframeMessageHandler) {
510
+ throw new Error('Iframe message handler not initialized');
511
+ }
512
+ return this.iframeMessageHandler.exportClientKeyshares({
513
+ chainName: this.chainName,
514
+ accountAddress,
515
+ password,
516
+ signedSessionId
517
+ });
518
+ }
519
+ /**
520
+ * keyShares is stringified list of EcdsaKeygenResult[] and Ed25519KeygenResult[]
521
+ */ async offlineExportPrivateKey({ keyShares, derivationPath }) {
522
+ await this.initializeMessageTransport();
523
+ if (!this.iframeMessageHandler) {
524
+ throw new Error('Iframe message handler not initialized');
525
+ }
526
+ const args = {
527
+ chainName: this.chainName,
528
+ keyShares,
529
+ derivationPath
530
+ };
531
+ const serializedArgs = JSON.stringify(args);
532
+ const argsBuffer = new TextEncoder().encode(serializedArgs);
533
+ const base64Args = Buffer.from(argsBuffer).toString('base64');
534
+ return this.iframeMessageHandler.offlineExportPrivateKey({
535
+ chainName: this.chainName,
536
+ base64Args
537
+ });
538
+ }
539
+ async cleanup() {
540
+ await this.initializeMessageTransport();
541
+ if (!this.iframeMessageHandler) {
542
+ throw new Error('Iframe message handler not initialized');
543
+ }
544
+ await this.iframeMessageHandler.cleanup();
545
+ if (this.iframe) {
546
+ DynamicWalletClient.iframeInstanceCount--;
547
+ if (DynamicWalletClient.sharedIframe && DynamicWalletClient.iframeInstanceCount === 0) {
548
+ document.body.removeChild(DynamicWalletClient.sharedIframe);
549
+ DynamicWalletClient.sharedIframe = null;
550
+ DynamicWalletClient.iframeLoadPromise = null;
551
+ }
552
+ this.iframe = null;
553
+ }
554
+ }
555
+ constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, chainName, debug }){
556
+ this.logger = logger;
557
+ this.instanceId = null;
558
+ this.iframeDomain = null;
559
+ this.messageTransport = null;
560
+ this.iframeMessageHandler = null;
561
+ this.iframe = null;
562
+ this.environmentId = environmentId;
563
+ this.authToken = authToken;
564
+ this.baseApiUrl = baseApiUrl;
565
+ this.baseMPCRelayApiUrl = baseMPCRelayApiUrl;
566
+ this.chainName = chainName;
567
+ const environment = getEnvironmentFromUrl(baseApiUrl);
568
+ this.iframeDomain = IFRAME_DOMAIN_MAP[environment];
569
+ // Generate unique instanceId when client is created
570
+ this.instanceId = crypto.randomUUID();
571
+ this.debug = Boolean(debug);
572
+ this.logger.setLogLevel(this.debug ? 'DEBUG' : 'INFO');
573
+ // initialize the client
574
+ this.initialize();
575
+ }
576
+ }
577
+ DynamicWalletClient.iframeLoadPromise = null;
578
+ DynamicWalletClient.sharedIframe = null;
579
+ DynamicWalletClient.iframeInstanceCount = 0;
580
+
581
+ export { DynamicWalletClient };
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@dynamic-labs-wallet/browser-wallet-client",
3
+ "version": "0.0.0-beta-191.1",
4
+ "license": "MIT",
5
+ "dependencies": {
6
+ "@dynamic-labs-wallet/core": "0.0.0-beta-191.1",
7
+ "@dynamic-labs/message-transport": "^4.9.9",
8
+ "@dynamic-labs/logger": "^4.9.9"
9
+ },
10
+ "nx": {
11
+ "sourceRoot": "packages/browser-wallet-client/src",
12
+ "projectType": "library",
13
+ "name": "browser-wallet-client",
14
+ "targets": {
15
+ "build": {}
16
+ }
17
+ },
18
+ "main": "./index.cjs.js",
19
+ "module": "./index.esm.js",
20
+ "types": "./index.esm.d.ts",
21
+ "exports": {
22
+ "./package.json": "./package.json",
23
+ ".": {
24
+ "types": "./index.esm.d.ts",
25
+ "import": "./index.esm.js",
26
+ "require": "./index.cjs.js",
27
+ "default": "./index.cjs.js"
28
+ }
29
+ }
30
+ }