@dynamic-labs-wallet/browser-wallet-client 0.0.0-beta.154.2 → 0.0.0-beta.3
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 +7 -5
- package/index.esm.js +8 -6
- package/package.json +2 -2
- package/src/client/client.d.ts +2 -3
- package/src/client/client.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -189,11 +189,12 @@ class DynamicWalletClient {
|
|
|
189
189
|
instanceId: (_this_instanceId = this.instanceId) != null ? _this_instanceId : '',
|
|
190
190
|
hostOrigin: window.location.origin,
|
|
191
191
|
environmentId: this.environmentId,
|
|
192
|
+
authToken: this.authToken,
|
|
192
193
|
baseApiUrl: this.baseApiUrl,
|
|
193
194
|
baseMPCRelayApiUrl: this.baseMPCRelayApiUrl,
|
|
194
195
|
chain: this.chainName
|
|
195
196
|
});
|
|
196
|
-
iframe.src = `${this.iframeDomain}/waas
|
|
197
|
+
iframe.src = `${this.iframeDomain}/waas/${this.environmentId}?${params.toString()}`;
|
|
197
198
|
this.logger.debug('Creating iframe with src:', iframe.src);
|
|
198
199
|
document.body.appendChild(iframe);
|
|
199
200
|
iframe.onload = ()=>{
|
|
@@ -229,11 +230,12 @@ class DynamicWalletClient {
|
|
|
229
230
|
instanceId: (_this_instanceId = this.instanceId) != null ? _this_instanceId : '',
|
|
230
231
|
hostOrigin: window.location.origin,
|
|
231
232
|
environmentId: this.environmentId,
|
|
233
|
+
authToken: this.authToken,
|
|
232
234
|
baseApiUrl: this.baseApiUrl,
|
|
233
235
|
baseMPCRelayApiUrl: this.baseMPCRelayApiUrl,
|
|
234
236
|
chain: this.chainName
|
|
235
237
|
});
|
|
236
|
-
iframe.src = `${this.iframeDomain}/waas
|
|
238
|
+
iframe.src = `${this.iframeDomain}/waas/${this.environmentId}?${params.toString()}`;
|
|
237
239
|
this.logger.debug('Creating iframe with src:', iframe.src);
|
|
238
240
|
// Add iframe to the provided container
|
|
239
241
|
container.appendChild(iframe);
|
|
@@ -288,7 +290,7 @@ class DynamicWalletClient {
|
|
|
288
290
|
}
|
|
289
291
|
return this.iframeMessageHandler.getWallets();
|
|
290
292
|
}
|
|
291
|
-
async getWallet({ accountAddress, walletOperation
|
|
293
|
+
async getWallet({ accountAddress, walletOperation }) {
|
|
292
294
|
await this.initializeIframeCommunication();
|
|
293
295
|
if (!this.iframeMessageHandler) {
|
|
294
296
|
throw new Error('Iframe message handler not initialized');
|
|
@@ -305,7 +307,7 @@ class DynamicWalletClient {
|
|
|
305
307
|
}
|
|
306
308
|
return this.iframeMessageHandler.createWalletAccount(thresholdSignatureScheme, password);
|
|
307
309
|
}
|
|
308
|
-
async requiresPasswordForOperation({ accountAddress, walletOperation
|
|
310
|
+
async requiresPasswordForOperation({ accountAddress, walletOperation }) {
|
|
309
311
|
await this.initializeIframeCommunication();
|
|
310
312
|
if (!this.iframeMessageHandler) {
|
|
311
313
|
throw new Error('Iframe message handler not initialized');
|
|
@@ -403,7 +405,7 @@ class DynamicWalletClient {
|
|
|
403
405
|
password
|
|
404
406
|
});
|
|
405
407
|
}
|
|
406
|
-
async verifyPassword({ accountAddress, password, walletOperation
|
|
408
|
+
async verifyPassword({ accountAddress, password, walletOperation }) {
|
|
407
409
|
await this.initializeIframeCommunication();
|
|
408
410
|
if (!this.iframeMessageHandler) {
|
|
409
411
|
throw new Error('Iframe message handler not initialized');
|
package/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseMessageTransportData, createRequestChannel, applyDefaultMessageOrigin, createMessageTransport } from '@dynamic-labs/message-transport';
|
|
2
2
|
import { Logger } from '@dynamic-labs/logger';
|
|
3
|
-
import {
|
|
3
|
+
import { getEnvironmentFromUrl, IFRAME_DOMAIN_MAP } from '@dynamic-labs-wallet/core';
|
|
4
4
|
export { MPC_RELAY_PREPROD_API_URL, MPC_RELAY_PROD_API_URL, ThresholdSignatureScheme, WalletOperation } from '@dynamic-labs-wallet/core';
|
|
5
5
|
export { BIP340KeygenResult, EcdsaKeygenResult, EcdsaSignature, Ed25519KeygenResult } from './internal/web';
|
|
6
6
|
|
|
@@ -188,11 +188,12 @@ class DynamicWalletClient {
|
|
|
188
188
|
instanceId: (_this_instanceId = this.instanceId) != null ? _this_instanceId : '',
|
|
189
189
|
hostOrigin: window.location.origin,
|
|
190
190
|
environmentId: this.environmentId,
|
|
191
|
+
authToken: this.authToken,
|
|
191
192
|
baseApiUrl: this.baseApiUrl,
|
|
192
193
|
baseMPCRelayApiUrl: this.baseMPCRelayApiUrl,
|
|
193
194
|
chain: this.chainName
|
|
194
195
|
});
|
|
195
|
-
iframe.src = `${this.iframeDomain}/waas
|
|
196
|
+
iframe.src = `${this.iframeDomain}/waas/${this.environmentId}?${params.toString()}`;
|
|
196
197
|
this.logger.debug('Creating iframe with src:', iframe.src);
|
|
197
198
|
document.body.appendChild(iframe);
|
|
198
199
|
iframe.onload = ()=>{
|
|
@@ -228,11 +229,12 @@ class DynamicWalletClient {
|
|
|
228
229
|
instanceId: (_this_instanceId = this.instanceId) != null ? _this_instanceId : '',
|
|
229
230
|
hostOrigin: window.location.origin,
|
|
230
231
|
environmentId: this.environmentId,
|
|
232
|
+
authToken: this.authToken,
|
|
231
233
|
baseApiUrl: this.baseApiUrl,
|
|
232
234
|
baseMPCRelayApiUrl: this.baseMPCRelayApiUrl,
|
|
233
235
|
chain: this.chainName
|
|
234
236
|
});
|
|
235
|
-
iframe.src = `${this.iframeDomain}/waas
|
|
237
|
+
iframe.src = `${this.iframeDomain}/waas/${this.environmentId}?${params.toString()}`;
|
|
236
238
|
this.logger.debug('Creating iframe with src:', iframe.src);
|
|
237
239
|
// Add iframe to the provided container
|
|
238
240
|
container.appendChild(iframe);
|
|
@@ -287,7 +289,7 @@ class DynamicWalletClient {
|
|
|
287
289
|
}
|
|
288
290
|
return this.iframeMessageHandler.getWallets();
|
|
289
291
|
}
|
|
290
|
-
async getWallet({ accountAddress, walletOperation
|
|
292
|
+
async getWallet({ accountAddress, walletOperation }) {
|
|
291
293
|
await this.initializeIframeCommunication();
|
|
292
294
|
if (!this.iframeMessageHandler) {
|
|
293
295
|
throw new Error('Iframe message handler not initialized');
|
|
@@ -304,7 +306,7 @@ class DynamicWalletClient {
|
|
|
304
306
|
}
|
|
305
307
|
return this.iframeMessageHandler.createWalletAccount(thresholdSignatureScheme, password);
|
|
306
308
|
}
|
|
307
|
-
async requiresPasswordForOperation({ accountAddress, walletOperation
|
|
309
|
+
async requiresPasswordForOperation({ accountAddress, walletOperation }) {
|
|
308
310
|
await this.initializeIframeCommunication();
|
|
309
311
|
if (!this.iframeMessageHandler) {
|
|
310
312
|
throw new Error('Iframe message handler not initialized');
|
|
@@ -402,7 +404,7 @@ class DynamicWalletClient {
|
|
|
402
404
|
password
|
|
403
405
|
});
|
|
404
406
|
}
|
|
405
|
-
async verifyPassword({ accountAddress, password, walletOperation
|
|
407
|
+
async verifyPassword({ accountAddress, password, walletOperation }) {
|
|
406
408
|
await this.initializeIframeCommunication();
|
|
407
409
|
if (!this.iframeMessageHandler) {
|
|
408
410
|
throw new Error('Iframe message handler not initialized');
|
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.
|
|
3
|
+
"version": "0.0.0-beta.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@dynamic-labs-wallet/core": "0.0.0-beta.
|
|
6
|
+
"@dynamic-labs-wallet/core": "0.0.0-beta.3",
|
|
7
7
|
"@dynamic-labs/message-transport": "^4.9.9",
|
|
8
8
|
"@dynamic-labs/logger": "^4.9.9",
|
|
9
9
|
"@noble/hashes": "1.7.1"
|
package/src/client/client.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type MessageTransportWithDefaultOrigin } from '@dynamic-labs/message-transport';
|
|
2
2
|
import { iframeMessageHandler } from '../services/iframeMessageHandler';
|
|
3
|
-
import type { ThresholdSignatureScheme, GetWalletResponse, CreateWalletAccountResponse, RequiresPasswordForOperationRequest, SignMessageRequest, IsPasswordEncryptedRequest, BackupKeySharesToGoogleDriveRequest, RefreshWalletAccountSharesRequest, ReshareRequest, VerifyPasswordRequest, UpdatePasswordRequest, ImportPrivateKeyRequest, ExportClientKeysharesRequest, OfflineExportPrivateKeyResponse } from '@dynamic-labs-wallet/core';
|
|
4
|
-
import { WalletOperation } from '@dynamic-labs-wallet/core';
|
|
3
|
+
import type { ThresholdSignatureScheme, WalletOperation, GetWalletResponse, CreateWalletAccountResponse, RequiresPasswordForOperationRequest, SignMessageRequest, IsPasswordEncryptedRequest, BackupKeySharesToGoogleDriveRequest, RefreshWalletAccountSharesRequest, ReshareRequest, VerifyPasswordRequest, UpdatePasswordRequest, ImportPrivateKeyRequest, ExportClientKeysharesRequest, OfflineExportPrivateKeyResponse } from '@dynamic-labs-wallet/core';
|
|
5
4
|
import { EcdsaKeygenResult, Ed25519KeygenResult } from '../../../internal/web';
|
|
6
5
|
export declare class DynamicWalletClient {
|
|
7
6
|
protected chainName: string;
|
|
@@ -70,7 +69,7 @@ export declare class DynamicWalletClient {
|
|
|
70
69
|
getWallets(): Promise<GetWalletResponse[]>;
|
|
71
70
|
getWallet({ accountAddress, walletOperation, }: {
|
|
72
71
|
accountAddress: string;
|
|
73
|
-
walletOperation
|
|
72
|
+
walletOperation: WalletOperation;
|
|
74
73
|
}): Promise<GetWalletResponse>;
|
|
75
74
|
createWalletAccount({ thresholdSignatureScheme, password, }: {
|
|
76
75
|
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
@@ -1 +1 @@
|
|
|
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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