@dynamic-labs-wallet/browser-wallet-client 0.0.0-beta.232.16 → 0.0.0-beta.232.2
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.cjs.js
CHANGED
|
@@ -1,15 +1,60 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var core = require('@dynamic-labs-wallet/core');
|
|
4
3
|
var messageTransport = require('@dynamic-labs/message-transport');
|
|
5
4
|
var logger$1 = require('@dynamic-labs/logger');
|
|
5
|
+
var core = require('@dynamic-labs-wallet/core');
|
|
6
|
+
|
|
7
|
+
const setupMessageTransportBridge = (messageTransport$1, iframe, iframeOrigin)=>{
|
|
8
|
+
if (!(iframe == null ? void 0 : iframe.contentWindow)) {
|
|
9
|
+
throw new Error('Iframe or contentWindow not available');
|
|
10
|
+
}
|
|
11
|
+
const logger = new logger$1.Logger('debug');
|
|
12
|
+
messageTransport$1.on((message)=>{
|
|
13
|
+
// Forward the message to webview via postMessage
|
|
14
|
+
if (message.origin === 'host') {
|
|
15
|
+
var _iframe_contentWindow;
|
|
16
|
+
iframe == null ? void 0 : (_iframe_contentWindow = iframe.contentWindow) == null ? void 0 : _iframe_contentWindow.postMessage(message, iframeOrigin);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const handleIncomingMessage = (message)=>{
|
|
20
|
+
const { data } = message;
|
|
21
|
+
if (!data) return;
|
|
22
|
+
if ((data == null ? void 0 : data.origin) !== 'webview') {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (typeof data !== 'object') {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
const message = messageTransport.parseMessageTransportData(data);
|
|
30
|
+
messageTransport$1.emit(message);
|
|
31
|
+
} catch (error) {
|
|
32
|
+
if (!(error instanceof SyntaxError)) {
|
|
33
|
+
logger.error('Error handling incoming message:', error);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Handle incoming message from android client
|
|
39
|
+
*/ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
document.addEventListener('message', handleIncomingMessage);
|
|
42
|
+
/**
|
|
43
|
+
* Handle incoming message from iOS client
|
|
44
|
+
*/ window.addEventListener('message', handleIncomingMessage);
|
|
45
|
+
};
|
|
6
46
|
|
|
7
47
|
class iframeMessageHandler {
|
|
8
48
|
async getWallets(request) {
|
|
9
49
|
return this.requestChannel.request('getWallets', request);
|
|
10
50
|
}
|
|
11
|
-
async getWallet(
|
|
12
|
-
return this.requestChannel.request('getWallet',
|
|
51
|
+
async getWallet({ chainName, accountAddress, walletOperation, signedSessionId }) {
|
|
52
|
+
return this.requestChannel.request('getWallet', {
|
|
53
|
+
chainName,
|
|
54
|
+
accountAddress,
|
|
55
|
+
walletOperation,
|
|
56
|
+
signedSessionId
|
|
57
|
+
});
|
|
13
58
|
}
|
|
14
59
|
async createWalletAccount(request) {
|
|
15
60
|
return this.requestChannel.request('createWalletAccount', request);
|
|
@@ -62,9 +107,6 @@ class iframeMessageHandler {
|
|
|
62
107
|
async offlineExportPrivateKey(request) {
|
|
63
108
|
return this.requestChannel.request('offlineExportPrivateKey', request);
|
|
64
109
|
}
|
|
65
|
-
async signTypedData(request) {
|
|
66
|
-
return this.requestChannel.request('signTypedData', request);
|
|
67
|
-
}
|
|
68
110
|
async cleanup() {
|
|
69
111
|
return this.requestChannel.request('cleanup');
|
|
70
112
|
}
|
|
@@ -75,46 +117,6 @@ class iframeMessageHandler {
|
|
|
75
117
|
|
|
76
118
|
const logger = new logger$1.Logger('DynamicWaasWalletClient');
|
|
77
119
|
|
|
78
|
-
const setupMessageTransportBridge = (messageTransport$1, iframe, iframeOrigin)=>{
|
|
79
|
-
if (!(iframe == null ? void 0 : iframe.contentWindow)) {
|
|
80
|
-
throw new Error('Iframe or contentWindow not available');
|
|
81
|
-
}
|
|
82
|
-
const logger = new logger$1.Logger('debug');
|
|
83
|
-
messageTransport$1.on((message)=>{
|
|
84
|
-
// Forward the message to webview via postMessage
|
|
85
|
-
if (message.origin === 'host') {
|
|
86
|
-
var _iframe_contentWindow;
|
|
87
|
-
iframe == null ? void 0 : (_iframe_contentWindow = iframe.contentWindow) == null ? void 0 : _iframe_contentWindow.postMessage(message, iframeOrigin);
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
const handleIncomingMessage = (message)=>{
|
|
91
|
-
const { data } = message;
|
|
92
|
-
if (!data) return;
|
|
93
|
-
if ((data == null ? void 0 : data.origin) !== 'webview') {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
if (typeof data !== 'object') {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
try {
|
|
100
|
-
const message = messageTransport.parseMessageTransportData(data);
|
|
101
|
-
messageTransport$1.emit(message);
|
|
102
|
-
} catch (error) {
|
|
103
|
-
if (!(error instanceof SyntaxError)) {
|
|
104
|
-
logger.error('Error handling incoming message:', error);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
/**
|
|
109
|
-
* Handle incoming message from android client
|
|
110
|
-
*/ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
111
|
-
// @ts-ignore
|
|
112
|
-
document.addEventListener('message', handleIncomingMessage);
|
|
113
|
-
/**
|
|
114
|
-
* Handle incoming message from iOS client
|
|
115
|
-
*/ window.addEventListener('message', handleIncomingMessage);
|
|
116
|
-
};
|
|
117
|
-
|
|
118
120
|
class DynamicWalletClient {
|
|
119
121
|
// Simply load the iframe from localhost
|
|
120
122
|
async initialize() {
|
|
@@ -311,7 +313,7 @@ class DynamicWalletClient {
|
|
|
311
313
|
chainName: this.chainName
|
|
312
314
|
});
|
|
313
315
|
}
|
|
314
|
-
async getWallet({ accountAddress, walletOperation = core.WalletOperation.NO_OPERATION, signedSessionId
|
|
316
|
+
async getWallet({ accountAddress, walletOperation = core.WalletOperation.NO_OPERATION, signedSessionId }) {
|
|
315
317
|
await this.initializeMessageTransport();
|
|
316
318
|
if (!this.iframeMessageHandler) {
|
|
317
319
|
throw new Error('Iframe message handler not initialized');
|
|
@@ -320,8 +322,7 @@ class DynamicWalletClient {
|
|
|
320
322
|
chainName: this.chainName,
|
|
321
323
|
accountAddress,
|
|
322
324
|
walletOperation,
|
|
323
|
-
signedSessionId
|
|
324
|
-
authToken
|
|
325
|
+
signedSessionId
|
|
325
326
|
});
|
|
326
327
|
}
|
|
327
328
|
async createWalletAccount({ thresholdSignatureScheme, password = undefined, signedSessionId, authToken }) {
|
|
@@ -412,19 +413,6 @@ class DynamicWalletClient {
|
|
|
412
413
|
authToken
|
|
413
414
|
});
|
|
414
415
|
}
|
|
415
|
-
async signTypedData({ accountAddress, typedData, password = undefined, signedSessionId }) {
|
|
416
|
-
await this.initializeMessageTransport();
|
|
417
|
-
if (!this.iframeMessageHandler) {
|
|
418
|
-
throw new Error('Iframe message handler not initialized');
|
|
419
|
-
}
|
|
420
|
-
return this.iframeMessageHandler.signTypedData({
|
|
421
|
-
chainName: this.chainName,
|
|
422
|
-
accountAddress,
|
|
423
|
-
typedData: JSON.stringify(typedData),
|
|
424
|
-
password,
|
|
425
|
-
signedSessionId
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
416
|
async backupKeySharesToGoogleDrive({ accountAddress, password = undefined, signedSessionId, authToken }) {
|
|
429
417
|
await this.initializeMessageTransport();
|
|
430
418
|
if (!this.iframeMessageHandler) {
|
|
@@ -524,7 +512,7 @@ class DynamicWalletClient {
|
|
|
524
512
|
authToken
|
|
525
513
|
});
|
|
526
514
|
}
|
|
527
|
-
async importPrivateKey({ privateKey, thresholdSignatureScheme,
|
|
515
|
+
async importPrivateKey({ privateKey, thresholdSignatureScheme, authToken }) {
|
|
528
516
|
await this.initializeMessageTransport();
|
|
529
517
|
if (!this.iframeMessageHandler) {
|
|
530
518
|
throw new Error('Iframe message handler not initialized');
|
|
@@ -533,7 +521,6 @@ class DynamicWalletClient {
|
|
|
533
521
|
chainName: this.chainName,
|
|
534
522
|
privateKey,
|
|
535
523
|
thresholdSignatureScheme,
|
|
536
|
-
signedSessionId,
|
|
537
524
|
authToken
|
|
538
525
|
});
|
|
539
526
|
}
|
package/index.esm.js
CHANGED
|
@@ -1,14 +1,59 @@
|
|
|
1
|
+
import { parseMessageTransportData, createRequestChannel, applyDefaultMessageOrigin, createMessageTransport } from '@dynamic-labs/message-transport';
|
|
2
|
+
import { Logger } from '@dynamic-labs/logger';
|
|
1
3
|
import { WalletOperation, getEnvironmentFromUrl, IFRAME_DOMAIN_MAP } from '@dynamic-labs-wallet/core';
|
|
2
4
|
export { MPC_RELAY_PREPROD_API_URL, MPC_RELAY_PROD_API_URL, ThresholdSignatureScheme, WalletOperation } from '@dynamic-labs-wallet/core';
|
|
3
|
-
|
|
4
|
-
|
|
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
|
+
};
|
|
5
45
|
|
|
6
46
|
class iframeMessageHandler {
|
|
7
47
|
async getWallets(request) {
|
|
8
48
|
return this.requestChannel.request('getWallets', request);
|
|
9
49
|
}
|
|
10
|
-
async getWallet(
|
|
11
|
-
return this.requestChannel.request('getWallet',
|
|
50
|
+
async getWallet({ chainName, accountAddress, walletOperation, signedSessionId }) {
|
|
51
|
+
return this.requestChannel.request('getWallet', {
|
|
52
|
+
chainName,
|
|
53
|
+
accountAddress,
|
|
54
|
+
walletOperation,
|
|
55
|
+
signedSessionId
|
|
56
|
+
});
|
|
12
57
|
}
|
|
13
58
|
async createWalletAccount(request) {
|
|
14
59
|
return this.requestChannel.request('createWalletAccount', request);
|
|
@@ -61,9 +106,6 @@ class iframeMessageHandler {
|
|
|
61
106
|
async offlineExportPrivateKey(request) {
|
|
62
107
|
return this.requestChannel.request('offlineExportPrivateKey', request);
|
|
63
108
|
}
|
|
64
|
-
async signTypedData(request) {
|
|
65
|
-
return this.requestChannel.request('signTypedData', request);
|
|
66
|
-
}
|
|
67
109
|
async cleanup() {
|
|
68
110
|
return this.requestChannel.request('cleanup');
|
|
69
111
|
}
|
|
@@ -74,46 +116,6 @@ class iframeMessageHandler {
|
|
|
74
116
|
|
|
75
117
|
const logger = new Logger('DynamicWaasWalletClient');
|
|
76
118
|
|
|
77
|
-
const setupMessageTransportBridge = (messageTransport, iframe, iframeOrigin)=>{
|
|
78
|
-
if (!(iframe == null ? void 0 : iframe.contentWindow)) {
|
|
79
|
-
throw new Error('Iframe or contentWindow not available');
|
|
80
|
-
}
|
|
81
|
-
const logger = new Logger('debug');
|
|
82
|
-
messageTransport.on((message)=>{
|
|
83
|
-
// Forward the message to webview via postMessage
|
|
84
|
-
if (message.origin === 'host') {
|
|
85
|
-
var _iframe_contentWindow;
|
|
86
|
-
iframe == null ? void 0 : (_iframe_contentWindow = iframe.contentWindow) == null ? void 0 : _iframe_contentWindow.postMessage(message, iframeOrigin);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
const handleIncomingMessage = (message)=>{
|
|
90
|
-
const { data } = message;
|
|
91
|
-
if (!data) return;
|
|
92
|
-
if ((data == null ? void 0 : data.origin) !== 'webview') {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
if (typeof data !== 'object') {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
try {
|
|
99
|
-
const message = parseMessageTransportData(data);
|
|
100
|
-
messageTransport.emit(message);
|
|
101
|
-
} catch (error) {
|
|
102
|
-
if (!(error instanceof SyntaxError)) {
|
|
103
|
-
logger.error('Error handling incoming message:', error);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
/**
|
|
108
|
-
* Handle incoming message from android client
|
|
109
|
-
*/ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
110
|
-
// @ts-ignore
|
|
111
|
-
document.addEventListener('message', handleIncomingMessage);
|
|
112
|
-
/**
|
|
113
|
-
* Handle incoming message from iOS client
|
|
114
|
-
*/ window.addEventListener('message', handleIncomingMessage);
|
|
115
|
-
};
|
|
116
|
-
|
|
117
119
|
class DynamicWalletClient {
|
|
118
120
|
// Simply load the iframe from localhost
|
|
119
121
|
async initialize() {
|
|
@@ -310,7 +312,7 @@ class DynamicWalletClient {
|
|
|
310
312
|
chainName: this.chainName
|
|
311
313
|
});
|
|
312
314
|
}
|
|
313
|
-
async getWallet({ accountAddress, walletOperation = WalletOperation.NO_OPERATION, signedSessionId
|
|
315
|
+
async getWallet({ accountAddress, walletOperation = WalletOperation.NO_OPERATION, signedSessionId }) {
|
|
314
316
|
await this.initializeMessageTransport();
|
|
315
317
|
if (!this.iframeMessageHandler) {
|
|
316
318
|
throw new Error('Iframe message handler not initialized');
|
|
@@ -319,8 +321,7 @@ class DynamicWalletClient {
|
|
|
319
321
|
chainName: this.chainName,
|
|
320
322
|
accountAddress,
|
|
321
323
|
walletOperation,
|
|
322
|
-
signedSessionId
|
|
323
|
-
authToken
|
|
324
|
+
signedSessionId
|
|
324
325
|
});
|
|
325
326
|
}
|
|
326
327
|
async createWalletAccount({ thresholdSignatureScheme, password = undefined, signedSessionId, authToken }) {
|
|
@@ -411,19 +412,6 @@ class DynamicWalletClient {
|
|
|
411
412
|
authToken
|
|
412
413
|
});
|
|
413
414
|
}
|
|
414
|
-
async signTypedData({ accountAddress, typedData, password = undefined, signedSessionId }) {
|
|
415
|
-
await this.initializeMessageTransport();
|
|
416
|
-
if (!this.iframeMessageHandler) {
|
|
417
|
-
throw new Error('Iframe message handler not initialized');
|
|
418
|
-
}
|
|
419
|
-
return this.iframeMessageHandler.signTypedData({
|
|
420
|
-
chainName: this.chainName,
|
|
421
|
-
accountAddress,
|
|
422
|
-
typedData: JSON.stringify(typedData),
|
|
423
|
-
password,
|
|
424
|
-
signedSessionId
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
415
|
async backupKeySharesToGoogleDrive({ accountAddress, password = undefined, signedSessionId, authToken }) {
|
|
428
416
|
await this.initializeMessageTransport();
|
|
429
417
|
if (!this.iframeMessageHandler) {
|
|
@@ -523,7 +511,7 @@ class DynamicWalletClient {
|
|
|
523
511
|
authToken
|
|
524
512
|
});
|
|
525
513
|
}
|
|
526
|
-
async importPrivateKey({ privateKey, thresholdSignatureScheme,
|
|
514
|
+
async importPrivateKey({ privateKey, thresholdSignatureScheme, authToken }) {
|
|
527
515
|
await this.initializeMessageTransport();
|
|
528
516
|
if (!this.iframeMessageHandler) {
|
|
529
517
|
throw new Error('Iframe message handler not initialized');
|
|
@@ -532,7 +520,6 @@ class DynamicWalletClient {
|
|
|
532
520
|
chainName: this.chainName,
|
|
533
521
|
privateKey,
|
|
534
522
|
thresholdSignatureScheme,
|
|
535
|
-
signedSessionId,
|
|
536
523
|
authToken
|
|
537
524
|
});
|
|
538
525
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/browser-wallet-client",
|
|
3
|
-
"version": "0.0.0-beta.232.
|
|
3
|
+
"version": "0.0.0-beta.232.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@dynamic-labs-wallet/core": "0.0.0-beta.232.
|
|
6
|
+
"@dynamic-labs-wallet/core": "0.0.0-beta.232.2",
|
|
7
7
|
"@dynamic-labs/message-transport": "^4.9.9",
|
|
8
8
|
"@dynamic-labs/logger": "^4.9.9"
|
|
9
9
|
},
|
package/src/client/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { BackupKeySharesToGoogleDriveRequest, CreateWalletAccountRequest, CreateWalletAccountResponse, ExportClientKeysharesRequest, GetWalletResponse, ImportPrivateKeyRequest, IsPasswordEncryptedRequest, OfflineExportPrivateKeyResponse, RefreshWalletAccountSharesRequest, RequiresPasswordForOperationRequest, ReshareRequest, SignMessageRequest, SignRawMessageRequest, SignTransactionRequest, SignTypedDataRequest, UpdatePasswordRequest, VerifyPasswordRequest } from '@dynamic-labs-wallet/core';
|
|
2
|
-
import { WalletOperation } from '@dynamic-labs-wallet/core';
|
|
3
1
|
import { type MessageTransportWithDefaultOrigin } from '@dynamic-labs/message-transport';
|
|
4
2
|
import { iframeMessageHandler } from '../services/iframeMessageHandler';
|
|
3
|
+
import type { GetWalletResponse, CreateWalletAccountResponse, RequiresPasswordForOperationRequest, SignMessageRequest, IsPasswordEncryptedRequest, BackupKeySharesToGoogleDriveRequest, VerifyPasswordRequest, UpdatePasswordRequest, ImportPrivateKeyRequest, ExportClientKeysharesRequest, OfflineExportPrivateKeyResponse, SignRawMessageRequest, CreateWalletAccountRequest, SignTransactionRequest, RefreshWalletAccountSharesRequest, ReshareRequest } from '@dynamic-labs-wallet/core';
|
|
4
|
+
import { WalletOperation } from '@dynamic-labs-wallet/core';
|
|
5
5
|
export declare class DynamicWalletClient {
|
|
6
6
|
protected chainName: string;
|
|
7
7
|
protected logger: import("@dynamic-labs/logger").Logger;
|
|
@@ -71,11 +71,10 @@ export declare class DynamicWalletClient {
|
|
|
71
71
|
cleanup: () => void;
|
|
72
72
|
}>;
|
|
73
73
|
getWallets(): Promise<GetWalletResponse[]>;
|
|
74
|
-
getWallet({ accountAddress, walletOperation, signedSessionId,
|
|
74
|
+
getWallet({ accountAddress, walletOperation, signedSessionId, }: {
|
|
75
75
|
accountAddress: string;
|
|
76
76
|
walletOperation?: WalletOperation;
|
|
77
77
|
signedSessionId?: string;
|
|
78
|
-
authToken?: string;
|
|
79
78
|
}): Promise<GetWalletResponse>;
|
|
80
79
|
createWalletAccount({ thresholdSignatureScheme, password, signedSessionId, authToken, }: Omit<CreateWalletAccountRequest, 'chainName'>): Promise<CreateWalletAccountResponse>;
|
|
81
80
|
requiresPasswordForOperation({ accountAddress, walletOperation, authToken, }: Omit<RequiresPasswordForOperationRequest, 'chainName'>): Promise<boolean>;
|
|
@@ -94,7 +93,6 @@ export declare class DynamicWalletClient {
|
|
|
94
93
|
* const txString = Buffer.from(txBytes).toString("hex");
|
|
95
94
|
*/
|
|
96
95
|
signTransaction({ senderAddress, transaction, password, signedSessionId, authToken, }: Omit<SignTransactionRequest, 'chainName'>): Promise<string>;
|
|
97
|
-
signTypedData({ accountAddress, typedData, password, signedSessionId, }: Omit<SignTypedDataRequest, 'chainName'>): Promise<string>;
|
|
98
96
|
backupKeySharesToGoogleDrive({ accountAddress, password, signedSessionId, authToken, }: Omit<BackupKeySharesToGoogleDriveRequest, 'chainName'>): Promise<void>;
|
|
99
97
|
restoreBackupFromGoogleDrive({ accountAddress, displayContainer, password, signedSessionId, authToken, }: {
|
|
100
98
|
accountAddress: string;
|
|
@@ -114,7 +112,7 @@ export declare class DynamicWalletClient {
|
|
|
114
112
|
}): Promise<void>;
|
|
115
113
|
verifyPassword({ accountAddress, password, walletOperation, signedSessionId, authToken, }: Omit<VerifyPasswordRequest, 'chainName'>): Promise<void>;
|
|
116
114
|
updatePassword({ accountAddress, existingPassword, newPassword, signedSessionId, authToken, }: Omit<UpdatePasswordRequest, 'chainName'>): Promise<void>;
|
|
117
|
-
importPrivateKey({ privateKey, thresholdSignatureScheme,
|
|
115
|
+
importPrivateKey({ privateKey, thresholdSignatureScheme, authToken, }: Omit<ImportPrivateKeyRequest, 'chainName'>): Promise<CreateWalletAccountResponse>;
|
|
118
116
|
exportClientKeyshares({ accountAddress, password, signedSessionId, authToken, }: Omit<ExportClientKeysharesRequest, 'chainName'>): Promise<void>;
|
|
119
117
|
/**
|
|
120
118
|
* keyShares is stringified list of EcdsaKeygenResult[] and Ed25519KeygenResult[]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,iCAAiC,EACvC,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,KAAK,EACV,iBAAiB,EACjB,2BAA2B,EAC3B,mCAAmC,EACnC,kBAAkB,EAClB,0BAA0B,EAC1B,mCAAmC,EACnC,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,4BAA4B,EAC5B,+BAA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EAAE,MAAM,CAAC;QAClB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBX,cAAc,CAAC,EACnB,cAAc,EACd,QAAQ,EACR,eAA8C,EAC9C,eAAe,EACf,SAAS,GACV,EAAE,IAAI,CAAC,qBAAqB,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBrD,cAAc,CAAC,EACnB,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,SAAS,GACV,EAAE,IAAI,CAAC,qBAAqB,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBrD,gBAAgB,CAAC,EACrB,UAAU,EACV,wBAAwB,EACxB,SAAS,GACV,EAAE,IAAI,CACL,uBAAuB,EACvB,WAAW,CACZ,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAclC,qBAAqB,CAAC,EAC1B,cAAc,EACd,QAAQ,EACR,eAAe,EACf,SAAS,GACV,EAAE,IAAI,CAAC,4BAA4B,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAelE;;OAEG;IACG,uBAAuB,CAAC,EAC5B,SAAS,EACT,cAAc,GACf,EAAE;QACD,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,GAAG,OAAO,CAAC,+BAA+B,CAAC;IAqB/B,OAAO;CAqBrB"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { type MessageTransportWithDefaultOrigin, type RequestChannel } from '@dynamic-labs/message-transport';
|
|
2
|
-
import type { IframeRequestMessages, GetWalletResponse, CreateWalletAccountResponse, SignMessageRequest, RequiresPasswordForOperationRequest, SignTransactionRequest, IsPasswordEncryptedRequest, BackupKeySharesToGoogleDriveRequest, RestoreBackupFromGoogleDriveRequest, RefreshWalletAccountSharesRequest, ReshareRequest, ExportPrivateKeyRequest, VerifyPasswordRequest, UpdatePasswordRequest, ImportPrivateKeyRequest, ExportClientKeysharesRequest, OfflineExportPrivateKeyRequest, OfflineExportPrivateKeyResponse, SignRawMessageRequest, GetWalletsRequest, CreateWalletAccountRequest
|
|
2
|
+
import type { IframeRequestMessages, WalletOperation, GetWalletResponse, CreateWalletAccountResponse, SignMessageRequest, RequiresPasswordForOperationRequest, SignTransactionRequest, IsPasswordEncryptedRequest, BackupKeySharesToGoogleDriveRequest, RestoreBackupFromGoogleDriveRequest, RefreshWalletAccountSharesRequest, ReshareRequest, ExportPrivateKeyRequest, VerifyPasswordRequest, UpdatePasswordRequest, ImportPrivateKeyRequest, ExportClientKeysharesRequest, OfflineExportPrivateKeyRequest, OfflineExportPrivateKeyResponse, SignRawMessageRequest, GetWalletsRequest, CreateWalletAccountRequest } from '@dynamic-labs-wallet/core';
|
|
3
3
|
export declare class iframeMessageHandler {
|
|
4
4
|
requestChannel: RequestChannel<IframeRequestMessages>;
|
|
5
5
|
constructor(messageTransport: MessageTransportWithDefaultOrigin);
|
|
6
6
|
getWallets(request: GetWalletsRequest): Promise<GetWalletResponse[]>;
|
|
7
|
-
getWallet(
|
|
7
|
+
getWallet({ chainName, accountAddress, walletOperation, signedSessionId, }: {
|
|
8
|
+
chainName: string;
|
|
9
|
+
accountAddress: string;
|
|
10
|
+
walletOperation: WalletOperation;
|
|
11
|
+
signedSessionId?: string;
|
|
12
|
+
}): Promise<GetWalletResponse>;
|
|
8
13
|
createWalletAccount(request: CreateWalletAccountRequest): Promise<CreateWalletAccountResponse>;
|
|
9
14
|
requiresPasswordForOperation(request: RequiresPasswordForOperationRequest): Promise<boolean>;
|
|
10
15
|
signMessage(request: SignMessageRequest): Promise<string>;
|
|
@@ -22,7 +27,6 @@ export declare class iframeMessageHandler {
|
|
|
22
27
|
sendAuthToken(token: string): Promise<void>;
|
|
23
28
|
exportClientKeyshares(request: ExportClientKeysharesRequest): Promise<void>;
|
|
24
29
|
offlineExportPrivateKey(request: OfflineExportPrivateKeyRequest): Promise<OfflineExportPrivateKeyResponse>;
|
|
25
|
-
signTypedData(request: SignTypedDataRequest): Promise<string>;
|
|
26
30
|
cleanup(): Promise<void>;
|
|
27
31
|
}
|
|
28
32
|
//# sourceMappingURL=iframeMessageHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iframeMessageHandler.d.ts","sourceRoot":"","sources":["../../src/services/iframeMessageHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iCAAiC,EACtC,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EACjB,2BAA2B,EAC3B,kBAAkB,EAClB,mCAAmC,EACnC,sBAAsB,EACtB,0BAA0B,EAC1B,mCAAmC,EACnC,mCAAmC,EACnC,iCAAiC,EACjC,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAC9B,+BAA+B,EAC/B,qBAAqB,EACrB,iBAAiB,EACjB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"iframeMessageHandler.d.ts","sourceRoot":"","sources":["../../src/services/iframeMessageHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iCAAiC,EACtC,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,2BAA2B,EAC3B,kBAAkB,EAClB,mCAAmC,EACnC,sBAAsB,EACtB,0BAA0B,EAC1B,mCAAmC,EACnC,mCAAmC,EACnC,iCAAiC,EACjC,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAC9B,+BAA+B,EAC/B,qBAAqB,EACrB,iBAAiB,EACjB,0BAA0B,EAC3B,MAAM,2BAA2B,CAAC;AA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