@dynamic-labs-wallet/browser-wallet-client 1.0.17 → 1.0.18
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
CHANGED
|
@@ -434,11 +434,40 @@ class IframeManager {
|
|
|
434
434
|
throw error;
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
|
+
/**
|
|
438
|
+
* Resolves the `hostOrigin` embedded in the iframe URL, validating it so a
|
|
439
|
+
* caller-supplied value can never become an injection sink.
|
|
440
|
+
*
|
|
441
|
+
* Prefers the explicitly-configured `hostOrigin` (required on React Native,
|
|
442
|
+
* where `globalThis.location.origin` is `localhost`/meaningless), otherwise
|
|
443
|
+
* falls back to the browser's own origin. Either source is parsed as a URL
|
|
444
|
+
* and accepted only when it is a well-formed `http(s)` origin — anything else
|
|
445
|
+
* (`javascript:`, an opaque/malformed string, a non-`http(s)` scheme) is
|
|
446
|
+
* rejected and yields an empty string rather than being forwarded.
|
|
447
|
+
*/ resolveHostOrigin() {
|
|
448
|
+
var _globalThis_location;
|
|
449
|
+
var _this_hostOrigin;
|
|
450
|
+
const candidate = (_this_hostOrigin = this.hostOrigin) != null ? _this_hostOrigin : (_globalThis_location = globalThis.location) == null ? void 0 : _globalThis_location.origin;
|
|
451
|
+
if (!candidate) {
|
|
452
|
+
return '';
|
|
453
|
+
}
|
|
454
|
+
try {
|
|
455
|
+
const url = new URL(candidate);
|
|
456
|
+
if (url.protocol !== 'http:' && url.protocol !== 'https:') {
|
|
457
|
+
return '';
|
|
458
|
+
}
|
|
459
|
+
return url.origin;
|
|
460
|
+
} catch (e) {
|
|
461
|
+
return '';
|
|
462
|
+
}
|
|
463
|
+
}
|
|
437
464
|
buildIframeUrlSearchParams() {
|
|
438
465
|
var _this_instanceId, _this_sdkVersion, _this_baseClientKeysharesRelayApiUrl;
|
|
439
466
|
const params = new URLSearchParams({
|
|
440
467
|
instanceId: (_this_instanceId = this.instanceId) != null ? _this_instanceId : '',
|
|
441
|
-
hostOrigin
|
|
468
|
+
// Validated/normalized origin (explicit hostOrigin on React Native, else
|
|
469
|
+
// the browser's own origin). See resolveHostOrigin for the safety checks.
|
|
470
|
+
hostOrigin: this.resolveHostOrigin(),
|
|
442
471
|
environmentId: this.environmentId,
|
|
443
472
|
baseApiUrl: this.baseApiUrl,
|
|
444
473
|
baseMPCRelayApiUrl: this.baseMPCRelayApiUrl,
|
|
@@ -865,7 +894,13 @@ class IframeManager {
|
|
|
865
894
|
* @param {HTMLElement} container - The container to which the iframe will be attached
|
|
866
895
|
* @returns {Promise<HTMLIFrameElement>} that resolves when the iframe is loaded
|
|
867
896
|
*/ loadIframeForContainer(container) {
|
|
868
|
-
|
|
897
|
+
/* eslint-disable no-restricted-globals -- This is the sanctioned web-only
|
|
898
|
+
DOM boundary for the embedded display iframe. `window`/`document` are
|
|
899
|
+
banned across browser-wallet-client (they are undefined on React Native /
|
|
900
|
+
Hermes and would crash the RN export path); this single method is the one
|
|
901
|
+
place allowed to touch them, mirroring the `createIframeWaasSDKContainer`
|
|
902
|
+
and `messageTransportBridge` web-only files. It is never reached on RN —
|
|
903
|
+
the native WebView container path is used there instead. */ return new Promise((resolve, reject)=>{
|
|
869
904
|
var _this_sdkVersion;
|
|
870
905
|
const context = {
|
|
871
906
|
iframeDomain: this.iframeDomain,
|
|
@@ -930,7 +965,7 @@ class IframeManager {
|
|
|
930
965
|
};
|
|
931
966
|
window.addEventListener('message', messageListener);
|
|
932
967
|
});
|
|
933
|
-
}
|
|
968
|
+
/* eslint-enable no-restricted-globals */ }
|
|
934
969
|
/**
|
|
935
970
|
* Initializes the iframe display for a specific container.
|
|
936
971
|
*
|
|
@@ -970,6 +1005,102 @@ class IframeManager {
|
|
|
970
1005
|
throw error;
|
|
971
1006
|
}
|
|
972
1007
|
}
|
|
1008
|
+
/**
|
|
1009
|
+
* Drives the handshake load for a caller-provided {@link WaasSDKContainer}
|
|
1010
|
+
* used as a *visible* private-key display surface (e.g. a React Native native
|
|
1011
|
+
* WebView). Resolves once the container reports the
|
|
1012
|
+
* `iframe-ready-${instanceId}` handshake; rejects on a container-level error
|
|
1013
|
+
* or load timeout.
|
|
1014
|
+
*
|
|
1015
|
+
* Unlike {@link loadIframe}, this deliberately does NOT touch the shared
|
|
1016
|
+
* signing container or its retry/static state: the display container is owned
|
|
1017
|
+
* by the caller, lives only for the duration of a single export ceremony, and
|
|
1018
|
+
* renders the key inside its own sandboxed document. The key is therefore
|
|
1019
|
+
* never sent back across the bridge to the host — keeping the
|
|
1020
|
+
* "host cannot read the key" invariant identical to the web iframe path.
|
|
1021
|
+
*/ loadWaasSDKContainerForDisplay(waasSDKContainer) {
|
|
1022
|
+
return new Promise((resolve, reject)=>{
|
|
1023
|
+
// settle() captures timeoutId/unsubscribe* declared below; they are
|
|
1024
|
+
// assigned synchronously before any async callback (setUrl rejection,
|
|
1025
|
+
// onError, onMessage, timeout) can fire, so the references are always live.
|
|
1026
|
+
const settle = (error)=>{
|
|
1027
|
+
clearTimeout(timeoutId);
|
|
1028
|
+
unsubscribeHandshake();
|
|
1029
|
+
unsubscribeError();
|
|
1030
|
+
if (error) {
|
|
1031
|
+
// Avoid Object's default '[object Object]' stringification: keep Error
|
|
1032
|
+
// instances as-is, use a string reason directly, otherwise a stable
|
|
1033
|
+
// message (the raw non-Error value carries no reliable text).
|
|
1034
|
+
const reason = typeof error === 'string' ? error : 'Display container failed to load';
|
|
1035
|
+
reject(error instanceof Error ? error : new Error(reason));
|
|
1036
|
+
} else {
|
|
1037
|
+
resolve();
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
1040
|
+
const timeoutId = setTimeout(()=>{
|
|
1041
|
+
settle(new Error('Display container load timeout'));
|
|
1042
|
+
}, IframeManager.iframeLoadTimeout);
|
|
1043
|
+
// Surface container-level errors (load failure, navigation/CSP block) so
|
|
1044
|
+
// we don't wait out the full timeout.
|
|
1045
|
+
const unsubscribeError = waasSDKContainer.onError((error)=>{
|
|
1046
|
+
settle(error != null ? error : new Error('Display container failed to load'));
|
|
1047
|
+
});
|
|
1048
|
+
// The hosted page posts `iframe-ready-${instanceId}` once it is ready to
|
|
1049
|
+
// receive transport messages — the same handshake the signing container uses.
|
|
1050
|
+
const unsubscribeHandshake = waasSDKContainer.onMessage((data)=>{
|
|
1051
|
+
if (data === `iframe-ready-${this.instanceId}`) {
|
|
1052
|
+
settle();
|
|
1053
|
+
}
|
|
1054
|
+
});
|
|
1055
|
+
const url = this.buildIframeUrl();
|
|
1056
|
+
this.logger.debug('Loading display container with src:', url);
|
|
1057
|
+
waasSDKContainer.setUrl(url).catch((error)=>{
|
|
1058
|
+
settle(error);
|
|
1059
|
+
});
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* Initializes a private-key display surface backed by a caller-provided
|
|
1064
|
+
* {@link WaasSDKContainer} (e.g. a visible React Native WebView) instead of a
|
|
1065
|
+
* DOM {@link HTMLElement}. This is the container-based counterpart to
|
|
1066
|
+
* {@link initializeIframeDisplayForContainer}: it reuses the same
|
|
1067
|
+
* {@link setupWaasSDKContainerBridge} transport wiring the signing flow uses,
|
|
1068
|
+
* so the export ceremony runs — and the key is rendered — entirely inside the
|
|
1069
|
+
* container's own sandboxed document.
|
|
1070
|
+
*
|
|
1071
|
+
* The caller owns the container's mount/visibility. The returned `cleanup`
|
|
1072
|
+
* detaches the transport bridge and calls `container.destroy()`.
|
|
1073
|
+
*/ async initializeDisplayForWaasSDKContainer({ waasSDKContainer }) {
|
|
1074
|
+
try {
|
|
1075
|
+
await this.loadWaasSDKContainerForDisplay(waasSDKContainer);
|
|
1076
|
+
const transport = messageTransport.applyDefaultMessageOrigin({
|
|
1077
|
+
defaultOrigin: 'host',
|
|
1078
|
+
messageTransport: messageTransport.createMessageTransport()
|
|
1079
|
+
});
|
|
1080
|
+
const cleanupBridge = this.setupWaasSDKContainerBridge(transport, waasSDKContainer);
|
|
1081
|
+
const iframeDisplay = new iframeMessageHandler(transport);
|
|
1082
|
+
// Set up iframe request handlers on this transport so the display
|
|
1083
|
+
// container can access key shares (e.g. for exportPrivateKey) and the
|
|
1084
|
+
// signed session ID — mirrors initializeIframeDisplayForContainer.
|
|
1085
|
+
if (this.secureStorage || this.getSignedSessionIdCallback) {
|
|
1086
|
+
this.setupIframeRequestHandlers(transport);
|
|
1087
|
+
}
|
|
1088
|
+
var _this_authMode;
|
|
1089
|
+
// if authMode is header: inform the container of the authMode with auth token
|
|
1090
|
+
// if authMode is cookie: inform the container of the authMode with empty authToken
|
|
1091
|
+
await iframeDisplay.sendAuthToken(this.authToken, (_this_authMode = this.authMode) != null ? _this_authMode : core.AuthMode.HEADER);
|
|
1092
|
+
return {
|
|
1093
|
+
iframeDisplay,
|
|
1094
|
+
cleanup: ()=>{
|
|
1095
|
+
cleanupBridge();
|
|
1096
|
+
waasSDKContainer.destroy();
|
|
1097
|
+
}
|
|
1098
|
+
};
|
|
1099
|
+
} catch (error) {
|
|
1100
|
+
this.logger.error('Error initializing display container:', error);
|
|
1101
|
+
throw error;
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
973
1104
|
async cleanup() {
|
|
974
1105
|
await this.initializeMessageTransport();
|
|
975
1106
|
if (!this.iframeMessageHandler) {
|
|
@@ -1025,7 +1156,7 @@ class IframeManager {
|
|
|
1025
1156
|
this.unauthorizedHandled = false;
|
|
1026
1157
|
}
|
|
1027
1158
|
}
|
|
1028
|
-
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, chainName, sdkVersion, authMode = core.AuthMode.HEADER, authToken, debug, baseClientKeysharesRelayApiUrl, additionalTrustedOrigins, iframeLoadTimeout, maxRetryAttempts }, internalOptions){
|
|
1159
|
+
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, chainName, sdkVersion, authMode = core.AuthMode.HEADER, authToken, debug, baseClientKeysharesRelayApiUrl, additionalTrustedOrigins, hostOrigin, iframeLoadTimeout, maxRetryAttempts }, internalOptions){
|
|
1029
1160
|
this.logger = logger;
|
|
1030
1161
|
this.instanceId = null;
|
|
1031
1162
|
this.iframeDomain = null;
|
|
@@ -1051,6 +1182,7 @@ class IframeManager {
|
|
|
1051
1182
|
this.additionalTrustedOrigins = additionalTrustedOrigins ? [
|
|
1052
1183
|
...additionalTrustedOrigins
|
|
1053
1184
|
] : [];
|
|
1185
|
+
this.hostOrigin = hostOrigin;
|
|
1054
1186
|
// Set secure storage adapter if provided (internal use only)
|
|
1055
1187
|
if (internalOptions == null ? void 0 : internalOptions.secureStorage) {
|
|
1056
1188
|
this.secureStorage = internalOptions.secureStorage;
|
|
@@ -1344,8 +1476,24 @@ class DynamicWalletClient extends IframeManager {
|
|
|
1344
1476
|
traceContext
|
|
1345
1477
|
}));
|
|
1346
1478
|
}
|
|
1347
|
-
async exportPrivateKey({ accountAddress, elevatedAccessToken, displayContainer, password, signedSessionId, authToken, mfaToken, traceContext, bitcoinConfig }) {
|
|
1348
|
-
|
|
1479
|
+
async exportPrivateKey({ accountAddress, elevatedAccessToken, displayContainer, container, password, signedSessionId, authToken, mfaToken, traceContext, bitcoinConfig }) {
|
|
1480
|
+
// Exactly one display surface is required. `displayContainer` (a DOM element,
|
|
1481
|
+
// web) injects a visible iframe into the page; `container` (a
|
|
1482
|
+
// WaasSDKContainer, e.g. a React Native native WebView) drives the ceremony
|
|
1483
|
+
// over the message bridge. Both render the key inside their own sandboxed
|
|
1484
|
+
// document, so the raw key never crosses back to the host.
|
|
1485
|
+
if (displayContainer && container) {
|
|
1486
|
+
throw new Error('exportPrivateKey accepts either displayContainer (web) or container (native), not both');
|
|
1487
|
+
}
|
|
1488
|
+
if (!displayContainer && !container) {
|
|
1489
|
+
throw new Error('exportPrivateKey requires a displayContainer (web) or a container (native)');
|
|
1490
|
+
}
|
|
1491
|
+
// The guards above guarantee exactly one is set, so when `container` is
|
|
1492
|
+
// absent `displayContainer` is necessarily present (TS cannot narrow this
|
|
1493
|
+
// across the two runtime guards, hence the assertion).
|
|
1494
|
+
const { iframeDisplay } = container ? await this.initializeDisplayForWaasSDKContainer({
|
|
1495
|
+
waasSDKContainer: container
|
|
1496
|
+
}) : await this.initializeIframeDisplayForContainer({
|
|
1349
1497
|
container: displayContainer
|
|
1350
1498
|
});
|
|
1351
1499
|
if (!iframeDisplay) {
|
|
@@ -1495,7 +1643,7 @@ class DynamicWalletClient extends IframeManager {
|
|
|
1495
1643
|
traceContext
|
|
1496
1644
|
}));
|
|
1497
1645
|
}
|
|
1498
|
-
constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, baseClientKeysharesRelayApiUrl, chainName, sdkVersion, debug, authMode = core.AuthMode.HEADER, additionalTrustedOrigins, iframeLoadTimeout, maxRetryAttempts }, internalOptions){
|
|
1646
|
+
constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, baseClientKeysharesRelayApiUrl, chainName, sdkVersion, debug, authMode = core.AuthMode.HEADER, additionalTrustedOrigins, hostOrigin, iframeLoadTimeout, maxRetryAttempts }, internalOptions){
|
|
1499
1647
|
super({
|
|
1500
1648
|
environmentId,
|
|
1501
1649
|
authToken,
|
|
@@ -1507,6 +1655,7 @@ class DynamicWalletClient extends IframeManager {
|
|
|
1507
1655
|
debug,
|
|
1508
1656
|
authMode,
|
|
1509
1657
|
additionalTrustedOrigins,
|
|
1658
|
+
hostOrigin,
|
|
1510
1659
|
iframeLoadTimeout,
|
|
1511
1660
|
maxRetryAttempts
|
|
1512
1661
|
}, internalOptions);
|
package/index.esm.js
CHANGED
|
@@ -433,11 +433,40 @@ class IframeManager {
|
|
|
433
433
|
throw error;
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
+
/**
|
|
437
|
+
* Resolves the `hostOrigin` embedded in the iframe URL, validating it so a
|
|
438
|
+
* caller-supplied value can never become an injection sink.
|
|
439
|
+
*
|
|
440
|
+
* Prefers the explicitly-configured `hostOrigin` (required on React Native,
|
|
441
|
+
* where `globalThis.location.origin` is `localhost`/meaningless), otherwise
|
|
442
|
+
* falls back to the browser's own origin. Either source is parsed as a URL
|
|
443
|
+
* and accepted only when it is a well-formed `http(s)` origin — anything else
|
|
444
|
+
* (`javascript:`, an opaque/malformed string, a non-`http(s)` scheme) is
|
|
445
|
+
* rejected and yields an empty string rather than being forwarded.
|
|
446
|
+
*/ resolveHostOrigin() {
|
|
447
|
+
var _globalThis_location;
|
|
448
|
+
var _this_hostOrigin;
|
|
449
|
+
const candidate = (_this_hostOrigin = this.hostOrigin) != null ? _this_hostOrigin : (_globalThis_location = globalThis.location) == null ? void 0 : _globalThis_location.origin;
|
|
450
|
+
if (!candidate) {
|
|
451
|
+
return '';
|
|
452
|
+
}
|
|
453
|
+
try {
|
|
454
|
+
const url = new URL(candidate);
|
|
455
|
+
if (url.protocol !== 'http:' && url.protocol !== 'https:') {
|
|
456
|
+
return '';
|
|
457
|
+
}
|
|
458
|
+
return url.origin;
|
|
459
|
+
} catch (e) {
|
|
460
|
+
return '';
|
|
461
|
+
}
|
|
462
|
+
}
|
|
436
463
|
buildIframeUrlSearchParams() {
|
|
437
464
|
var _this_instanceId, _this_sdkVersion, _this_baseClientKeysharesRelayApiUrl;
|
|
438
465
|
const params = new URLSearchParams({
|
|
439
466
|
instanceId: (_this_instanceId = this.instanceId) != null ? _this_instanceId : '',
|
|
440
|
-
hostOrigin
|
|
467
|
+
// Validated/normalized origin (explicit hostOrigin on React Native, else
|
|
468
|
+
// the browser's own origin). See resolveHostOrigin for the safety checks.
|
|
469
|
+
hostOrigin: this.resolveHostOrigin(),
|
|
441
470
|
environmentId: this.environmentId,
|
|
442
471
|
baseApiUrl: this.baseApiUrl,
|
|
443
472
|
baseMPCRelayApiUrl: this.baseMPCRelayApiUrl,
|
|
@@ -864,7 +893,13 @@ class IframeManager {
|
|
|
864
893
|
* @param {HTMLElement} container - The container to which the iframe will be attached
|
|
865
894
|
* @returns {Promise<HTMLIFrameElement>} that resolves when the iframe is loaded
|
|
866
895
|
*/ loadIframeForContainer(container) {
|
|
867
|
-
|
|
896
|
+
/* eslint-disable no-restricted-globals -- This is the sanctioned web-only
|
|
897
|
+
DOM boundary for the embedded display iframe. `window`/`document` are
|
|
898
|
+
banned across browser-wallet-client (they are undefined on React Native /
|
|
899
|
+
Hermes and would crash the RN export path); this single method is the one
|
|
900
|
+
place allowed to touch them, mirroring the `createIframeWaasSDKContainer`
|
|
901
|
+
and `messageTransportBridge` web-only files. It is never reached on RN —
|
|
902
|
+
the native WebView container path is used there instead. */ return new Promise((resolve, reject)=>{
|
|
868
903
|
var _this_sdkVersion;
|
|
869
904
|
const context = {
|
|
870
905
|
iframeDomain: this.iframeDomain,
|
|
@@ -929,7 +964,7 @@ class IframeManager {
|
|
|
929
964
|
};
|
|
930
965
|
window.addEventListener('message', messageListener);
|
|
931
966
|
});
|
|
932
|
-
}
|
|
967
|
+
/* eslint-enable no-restricted-globals */ }
|
|
933
968
|
/**
|
|
934
969
|
* Initializes the iframe display for a specific container.
|
|
935
970
|
*
|
|
@@ -969,6 +1004,102 @@ class IframeManager {
|
|
|
969
1004
|
throw error;
|
|
970
1005
|
}
|
|
971
1006
|
}
|
|
1007
|
+
/**
|
|
1008
|
+
* Drives the handshake load for a caller-provided {@link WaasSDKContainer}
|
|
1009
|
+
* used as a *visible* private-key display surface (e.g. a React Native native
|
|
1010
|
+
* WebView). Resolves once the container reports the
|
|
1011
|
+
* `iframe-ready-${instanceId}` handshake; rejects on a container-level error
|
|
1012
|
+
* or load timeout.
|
|
1013
|
+
*
|
|
1014
|
+
* Unlike {@link loadIframe}, this deliberately does NOT touch the shared
|
|
1015
|
+
* signing container or its retry/static state: the display container is owned
|
|
1016
|
+
* by the caller, lives only for the duration of a single export ceremony, and
|
|
1017
|
+
* renders the key inside its own sandboxed document. The key is therefore
|
|
1018
|
+
* never sent back across the bridge to the host — keeping the
|
|
1019
|
+
* "host cannot read the key" invariant identical to the web iframe path.
|
|
1020
|
+
*/ loadWaasSDKContainerForDisplay(waasSDKContainer) {
|
|
1021
|
+
return new Promise((resolve, reject)=>{
|
|
1022
|
+
// settle() captures timeoutId/unsubscribe* declared below; they are
|
|
1023
|
+
// assigned synchronously before any async callback (setUrl rejection,
|
|
1024
|
+
// onError, onMessage, timeout) can fire, so the references are always live.
|
|
1025
|
+
const settle = (error)=>{
|
|
1026
|
+
clearTimeout(timeoutId);
|
|
1027
|
+
unsubscribeHandshake();
|
|
1028
|
+
unsubscribeError();
|
|
1029
|
+
if (error) {
|
|
1030
|
+
// Avoid Object's default '[object Object]' stringification: keep Error
|
|
1031
|
+
// instances as-is, use a string reason directly, otherwise a stable
|
|
1032
|
+
// message (the raw non-Error value carries no reliable text).
|
|
1033
|
+
const reason = typeof error === 'string' ? error : 'Display container failed to load';
|
|
1034
|
+
reject(error instanceof Error ? error : new Error(reason));
|
|
1035
|
+
} else {
|
|
1036
|
+
resolve();
|
|
1037
|
+
}
|
|
1038
|
+
};
|
|
1039
|
+
const timeoutId = setTimeout(()=>{
|
|
1040
|
+
settle(new Error('Display container load timeout'));
|
|
1041
|
+
}, IframeManager.iframeLoadTimeout);
|
|
1042
|
+
// Surface container-level errors (load failure, navigation/CSP block) so
|
|
1043
|
+
// we don't wait out the full timeout.
|
|
1044
|
+
const unsubscribeError = waasSDKContainer.onError((error)=>{
|
|
1045
|
+
settle(error != null ? error : new Error('Display container failed to load'));
|
|
1046
|
+
});
|
|
1047
|
+
// The hosted page posts `iframe-ready-${instanceId}` once it is ready to
|
|
1048
|
+
// receive transport messages — the same handshake the signing container uses.
|
|
1049
|
+
const unsubscribeHandshake = waasSDKContainer.onMessage((data)=>{
|
|
1050
|
+
if (data === `iframe-ready-${this.instanceId}`) {
|
|
1051
|
+
settle();
|
|
1052
|
+
}
|
|
1053
|
+
});
|
|
1054
|
+
const url = this.buildIframeUrl();
|
|
1055
|
+
this.logger.debug('Loading display container with src:', url);
|
|
1056
|
+
waasSDKContainer.setUrl(url).catch((error)=>{
|
|
1057
|
+
settle(error);
|
|
1058
|
+
});
|
|
1059
|
+
});
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* Initializes a private-key display surface backed by a caller-provided
|
|
1063
|
+
* {@link WaasSDKContainer} (e.g. a visible React Native WebView) instead of a
|
|
1064
|
+
* DOM {@link HTMLElement}. This is the container-based counterpart to
|
|
1065
|
+
* {@link initializeIframeDisplayForContainer}: it reuses the same
|
|
1066
|
+
* {@link setupWaasSDKContainerBridge} transport wiring the signing flow uses,
|
|
1067
|
+
* so the export ceremony runs — and the key is rendered — entirely inside the
|
|
1068
|
+
* container's own sandboxed document.
|
|
1069
|
+
*
|
|
1070
|
+
* The caller owns the container's mount/visibility. The returned `cleanup`
|
|
1071
|
+
* detaches the transport bridge and calls `container.destroy()`.
|
|
1072
|
+
*/ async initializeDisplayForWaasSDKContainer({ waasSDKContainer }) {
|
|
1073
|
+
try {
|
|
1074
|
+
await this.loadWaasSDKContainerForDisplay(waasSDKContainer);
|
|
1075
|
+
const transport = applyDefaultMessageOrigin({
|
|
1076
|
+
defaultOrigin: 'host',
|
|
1077
|
+
messageTransport: createMessageTransport()
|
|
1078
|
+
});
|
|
1079
|
+
const cleanupBridge = this.setupWaasSDKContainerBridge(transport, waasSDKContainer);
|
|
1080
|
+
const iframeDisplay = new iframeMessageHandler(transport);
|
|
1081
|
+
// Set up iframe request handlers on this transport so the display
|
|
1082
|
+
// container can access key shares (e.g. for exportPrivateKey) and the
|
|
1083
|
+
// signed session ID — mirrors initializeIframeDisplayForContainer.
|
|
1084
|
+
if (this.secureStorage || this.getSignedSessionIdCallback) {
|
|
1085
|
+
this.setupIframeRequestHandlers(transport);
|
|
1086
|
+
}
|
|
1087
|
+
var _this_authMode;
|
|
1088
|
+
// if authMode is header: inform the container of the authMode with auth token
|
|
1089
|
+
// if authMode is cookie: inform the container of the authMode with empty authToken
|
|
1090
|
+
await iframeDisplay.sendAuthToken(this.authToken, (_this_authMode = this.authMode) != null ? _this_authMode : AuthMode.HEADER);
|
|
1091
|
+
return {
|
|
1092
|
+
iframeDisplay,
|
|
1093
|
+
cleanup: ()=>{
|
|
1094
|
+
cleanupBridge();
|
|
1095
|
+
waasSDKContainer.destroy();
|
|
1096
|
+
}
|
|
1097
|
+
};
|
|
1098
|
+
} catch (error) {
|
|
1099
|
+
this.logger.error('Error initializing display container:', error);
|
|
1100
|
+
throw error;
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
972
1103
|
async cleanup() {
|
|
973
1104
|
await this.initializeMessageTransport();
|
|
974
1105
|
if (!this.iframeMessageHandler) {
|
|
@@ -1024,7 +1155,7 @@ class IframeManager {
|
|
|
1024
1155
|
this.unauthorizedHandled = false;
|
|
1025
1156
|
}
|
|
1026
1157
|
}
|
|
1027
|
-
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, chainName, sdkVersion, authMode = AuthMode.HEADER, authToken, debug, baseClientKeysharesRelayApiUrl, additionalTrustedOrigins, iframeLoadTimeout, maxRetryAttempts }, internalOptions){
|
|
1158
|
+
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, chainName, sdkVersion, authMode = AuthMode.HEADER, authToken, debug, baseClientKeysharesRelayApiUrl, additionalTrustedOrigins, hostOrigin, iframeLoadTimeout, maxRetryAttempts }, internalOptions){
|
|
1028
1159
|
this.logger = logger;
|
|
1029
1160
|
this.instanceId = null;
|
|
1030
1161
|
this.iframeDomain = null;
|
|
@@ -1050,6 +1181,7 @@ class IframeManager {
|
|
|
1050
1181
|
this.additionalTrustedOrigins = additionalTrustedOrigins ? [
|
|
1051
1182
|
...additionalTrustedOrigins
|
|
1052
1183
|
] : [];
|
|
1184
|
+
this.hostOrigin = hostOrigin;
|
|
1053
1185
|
// Set secure storage adapter if provided (internal use only)
|
|
1054
1186
|
if (internalOptions == null ? void 0 : internalOptions.secureStorage) {
|
|
1055
1187
|
this.secureStorage = internalOptions.secureStorage;
|
|
@@ -1343,8 +1475,24 @@ class DynamicWalletClient extends IframeManager {
|
|
|
1343
1475
|
traceContext
|
|
1344
1476
|
}));
|
|
1345
1477
|
}
|
|
1346
|
-
async exportPrivateKey({ accountAddress, elevatedAccessToken, displayContainer, password, signedSessionId, authToken, mfaToken, traceContext, bitcoinConfig }) {
|
|
1347
|
-
|
|
1478
|
+
async exportPrivateKey({ accountAddress, elevatedAccessToken, displayContainer, container, password, signedSessionId, authToken, mfaToken, traceContext, bitcoinConfig }) {
|
|
1479
|
+
// Exactly one display surface is required. `displayContainer` (a DOM element,
|
|
1480
|
+
// web) injects a visible iframe into the page; `container` (a
|
|
1481
|
+
// WaasSDKContainer, e.g. a React Native native WebView) drives the ceremony
|
|
1482
|
+
// over the message bridge. Both render the key inside their own sandboxed
|
|
1483
|
+
// document, so the raw key never crosses back to the host.
|
|
1484
|
+
if (displayContainer && container) {
|
|
1485
|
+
throw new Error('exportPrivateKey accepts either displayContainer (web) or container (native), not both');
|
|
1486
|
+
}
|
|
1487
|
+
if (!displayContainer && !container) {
|
|
1488
|
+
throw new Error('exportPrivateKey requires a displayContainer (web) or a container (native)');
|
|
1489
|
+
}
|
|
1490
|
+
// The guards above guarantee exactly one is set, so when `container` is
|
|
1491
|
+
// absent `displayContainer` is necessarily present (TS cannot narrow this
|
|
1492
|
+
// across the two runtime guards, hence the assertion).
|
|
1493
|
+
const { iframeDisplay } = container ? await this.initializeDisplayForWaasSDKContainer({
|
|
1494
|
+
waasSDKContainer: container
|
|
1495
|
+
}) : await this.initializeIframeDisplayForContainer({
|
|
1348
1496
|
container: displayContainer
|
|
1349
1497
|
});
|
|
1350
1498
|
if (!iframeDisplay) {
|
|
@@ -1494,7 +1642,7 @@ class DynamicWalletClient extends IframeManager {
|
|
|
1494
1642
|
traceContext
|
|
1495
1643
|
}));
|
|
1496
1644
|
}
|
|
1497
|
-
constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, baseClientKeysharesRelayApiUrl, chainName, sdkVersion, debug, authMode = AuthMode.HEADER, additionalTrustedOrigins, iframeLoadTimeout, maxRetryAttempts }, internalOptions){
|
|
1645
|
+
constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, baseClientKeysharesRelayApiUrl, chainName, sdkVersion, debug, authMode = AuthMode.HEADER, additionalTrustedOrigins, hostOrigin, iframeLoadTimeout, maxRetryAttempts }, internalOptions){
|
|
1498
1646
|
super({
|
|
1499
1647
|
environmentId,
|
|
1500
1648
|
authToken,
|
|
@@ -1506,6 +1654,7 @@ class DynamicWalletClient extends IframeManager {
|
|
|
1506
1654
|
debug,
|
|
1507
1655
|
authMode,
|
|
1508
1656
|
additionalTrustedOrigins,
|
|
1657
|
+
hostOrigin,
|
|
1509
1658
|
iframeLoadTimeout,
|
|
1510
1659
|
maxRetryAttempts
|
|
1511
1660
|
}, internalOptions);
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/browser-wallet-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/core": "1.0.
|
|
7
|
+
"@dynamic-labs-wallet/core": "1.0.18",
|
|
8
8
|
"@dynamic-labs/logger": "^4.45.2",
|
|
9
9
|
"@dynamic-labs/message-transport": "^4.45.2"
|
|
10
10
|
},
|
package/src/client/client.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { BackupKeySharesToGoogleDriveRequest, BackupKeySharesToICloudRequest, BitcoinConfig, CreateWaasSDKContainer, CreateWalletAccountRequest, CreateWalletAccountResponse, DelegateKeySharesRequest, ExportClientKeysharesRequest, GetWalletRecoveryStateRequest, GetWalletResponse, ImportPrivateKeyRequest, IsPasswordEncryptedRequest, OfflineExportPrivateKeyResponse, RefreshWalletAccountSharesRequest, RequestWithElevatedAccessToken, RequestWithTraceContext, RequiresPasswordForOperationRequest, ReshareRequest, RevokeDelegationRequest, SecureStorageAdapter, SetPasswordRequest, SignMessageRequestBrowser, SignRawMessageRequest, SignTransactionRequest, SignTypedDataRequest, UnlockWalletRequest, UpdatePasswordRequest, VerifyPasswordRequest, WalletRecoveryState } from '@dynamic-labs-wallet/core';
|
|
1
|
+
import type { BackupKeySharesToGoogleDriveRequest, BackupKeySharesToICloudRequest, BitcoinConfig, CreateWaasSDKContainer, CreateWalletAccountRequest, CreateWalletAccountResponse, DelegateKeySharesRequest, ExportClientKeysharesRequest, GetWalletRecoveryStateRequest, GetWalletResponse, ImportPrivateKeyRequest, IsPasswordEncryptedRequest, OfflineExportPrivateKeyResponse, RefreshWalletAccountSharesRequest, RequestWithElevatedAccessToken, RequestWithTraceContext, RequiresPasswordForOperationRequest, ReshareRequest, RevokeDelegationRequest, SecureStorageAdapter, SetPasswordRequest, SignMessageRequestBrowser, SignRawMessageRequest, SignTransactionRequest, SignTypedDataRequest, UnlockWalletRequest, UpdatePasswordRequest, VerifyPasswordRequest, WaasSDKContainer, WalletRecoveryState } from '@dynamic-labs-wallet/core';
|
|
2
2
|
import { AuthMode, WalletOperation } from '@dynamic-labs-wallet/core';
|
|
3
3
|
import { IframeManager } from './iframeManager/index.js';
|
|
4
4
|
export declare class DynamicWalletClient extends IframeManager {
|
|
5
|
-
constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, baseClientKeysharesRelayApiUrl, chainName, sdkVersion, debug, authMode, additionalTrustedOrigins, iframeLoadTimeout, maxRetryAttempts, }: {
|
|
5
|
+
constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, baseClientKeysharesRelayApiUrl, chainName, sdkVersion, debug, authMode, additionalTrustedOrigins, hostOrigin, iframeLoadTimeout, maxRetryAttempts, }: {
|
|
6
6
|
environmentId: string;
|
|
7
7
|
authToken: string;
|
|
8
8
|
baseApiUrl: string;
|
|
@@ -13,6 +13,11 @@ export declare class DynamicWalletClient extends IframeManager {
|
|
|
13
13
|
authMode?: AuthMode;
|
|
14
14
|
baseClientKeysharesRelayApiUrl?: string;
|
|
15
15
|
additionalTrustedOrigins?: readonly string[];
|
|
16
|
+
/**
|
|
17
|
+
* Explicit `hostOrigin` for the hosted iframe URL. Required on React
|
|
18
|
+
* Native (pass the app's universalLink); browsers may omit it.
|
|
19
|
+
*/
|
|
20
|
+
hostOrigin?: string;
|
|
16
21
|
/**
|
|
17
22
|
* Initial timeout (ms) for the iframe boot handshake. Doubles on each
|
|
18
23
|
* failed attempt up to 60s. Defaults to 20s.
|
|
@@ -76,9 +81,10 @@ export declare class DynamicWalletClient extends IframeManager {
|
|
|
76
81
|
}>): Promise<void>;
|
|
77
82
|
refreshWalletAccountShares({ accountAddress, password, signedSessionId, authToken, mfaToken, elevatedAccessToken, traceContext, }: RequestWithTraceContext<RequestWithElevatedAccessToken<Omit<RefreshWalletAccountSharesRequest, 'chainName'>>>): Promise<void>;
|
|
78
83
|
reshare({ accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password, signedSessionId, authToken, mfaToken, elevatedAccessToken, traceContext, }: RequestWithTraceContext<RequestWithElevatedAccessToken<Omit<ReshareRequest, 'chainName'>>>): Promise<void>;
|
|
79
|
-
exportPrivateKey({ accountAddress, elevatedAccessToken, displayContainer, password, signedSessionId, authToken, mfaToken, traceContext, bitcoinConfig, }: RequestWithTraceContext<RequestWithElevatedAccessToken<{
|
|
84
|
+
exportPrivateKey({ accountAddress, elevatedAccessToken, displayContainer, container, password, signedSessionId, authToken, mfaToken, traceContext, bitcoinConfig, }: RequestWithTraceContext<RequestWithElevatedAccessToken<{
|
|
80
85
|
accountAddress: string;
|
|
81
|
-
displayContainer
|
|
86
|
+
displayContainer?: HTMLElement;
|
|
87
|
+
container?: WaasSDKContainer;
|
|
82
88
|
password?: string;
|
|
83
89
|
signedSessionId: string;
|
|
84
90
|
authToken?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mCAAmC,EACnC,8BAA8B,EAC9B,aAAa,EACb,sBAAsB,EACtB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AC;QACrC,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;QAC3C,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;QAChD,cAAc,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KAC7C;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mCAAmC,EACnC,8BAA8B,EAC9B,aAAa,EACb,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,6BAA6B,EAC7B,iBAAiB,EACjB,uBAAuB,EACvB,0BAA0B,EAC1B,+BAA+B,EAC/B,iCAAiC,EACjC,8BAA8B,EAC9B,uBAAuB,EACvB,mCAAmC,EACnC,cAAc,EACd,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,qBAAa,mBAAoB,SAAQ,aAAa;gBAElD,EACE,aAAa,EACb,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,8BAA8B,EAC9B,SAAS,EACT,UAAU,EACV,KAAK,EACL,QAA0B,EAC1B,wBAAwB,EACxB,UAAU,EACV,iBAAiB,EACjB,gBAAgB,GACjB,EAAE;QACD,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,SAAS,EAAE,MAAM,CAAC;QACl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AC;IAiBvG,qBAAqB,CAAC,EAC1B,cAAc,EACd,QAAQ,EACR,eAAe,EACf,SAAS,EACT,YAAY,GACb,EAAE,uBAAuB,CAAC,IAAI,CAAC,4BAA4B,EAAE,WAAW,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAa3F;;OAEG;IACG,uBAAuB,CAAC,EAC5B,SAAS,EACT,cAAc,EACd,YAAY,GACb,EAAE,uBAAuB,CAAC;QACzB,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC,GAAG,OAAO,CAAC,+BAA+B,CAAC;CAmB9C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthMode, type CreateWaasSDKContainer, type IframeRequestMessages, type SecureStorageAdapter } from '@dynamic-labs-wallet/core';
|
|
1
|
+
import { AuthMode, type CreateWaasSDKContainer, type IframeRequestMessages, type SecureStorageAdapter, type WaasSDKContainer } from '@dynamic-labs-wallet/core';
|
|
2
2
|
import { type MessageTransportWithDefaultOrigin, type RequestChannel } from '@dynamic-labs/message-transport';
|
|
3
3
|
import { iframeMessageHandler } from '../../services/iframeMessageHandler.js';
|
|
4
4
|
export declare class IframeManager {
|
|
@@ -9,6 +9,7 @@ export declare class IframeManager {
|
|
|
9
9
|
environmentId: string;
|
|
10
10
|
private readonly authToken;
|
|
11
11
|
private readonly authMode;
|
|
12
|
+
private readonly hostOrigin;
|
|
12
13
|
baseApiUrl: string;
|
|
13
14
|
baseMPCRelayApiUrl: string;
|
|
14
15
|
protected messageTransport: MessageTransportWithDefaultOrigin | null;
|
|
@@ -84,7 +85,7 @@ export declare class IframeManager {
|
|
|
84
85
|
private readonly onUnauthorized?;
|
|
85
86
|
/** One-shot guard so a burst of 401 notifications triggers a single logout. */
|
|
86
87
|
private unauthorizedHandled;
|
|
87
|
-
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, chainName, sdkVersion, authMode, authToken, debug, baseClientKeysharesRelayApiUrl, additionalTrustedOrigins, iframeLoadTimeout, maxRetryAttempts, }: {
|
|
88
|
+
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, chainName, sdkVersion, authMode, authToken, debug, baseClientKeysharesRelayApiUrl, additionalTrustedOrigins, hostOrigin, iframeLoadTimeout, maxRetryAttempts, }: {
|
|
88
89
|
environmentId: string;
|
|
89
90
|
authMode: AuthMode;
|
|
90
91
|
authToken?: string;
|
|
@@ -95,6 +96,12 @@ export declare class IframeManager {
|
|
|
95
96
|
debug?: boolean;
|
|
96
97
|
baseClientKeysharesRelayApiUrl?: string;
|
|
97
98
|
additionalTrustedOrigins?: readonly string[];
|
|
99
|
+
/**
|
|
100
|
+
* Explicit `hostOrigin` for the hosted iframe URL. Required on non-browser
|
|
101
|
+
* runtimes (React Native) where `window.location.origin` is not a real,
|
|
102
|
+
* allowlisted origin. When omitted, falls back to `window.location.origin`.
|
|
103
|
+
*/
|
|
104
|
+
hostOrigin?: string;
|
|
98
105
|
/**
|
|
99
106
|
* Initial timeout in ms for the iframe boot handshake. Defaults to
|
|
100
107
|
* {@link IframeManager.iframeLoadTimeout}. Clamped to
|
|
@@ -137,6 +144,18 @@ export declare class IframeManager {
|
|
|
137
144
|
* and initializing the message transport and iframe storage after iframe is successfully loaded
|
|
138
145
|
*/
|
|
139
146
|
private doInitializeIframeCommunication;
|
|
147
|
+
/**
|
|
148
|
+
* Resolves the `hostOrigin` embedded in the iframe URL, validating it so a
|
|
149
|
+
* caller-supplied value can never become an injection sink.
|
|
150
|
+
*
|
|
151
|
+
* Prefers the explicitly-configured `hostOrigin` (required on React Native,
|
|
152
|
+
* where `globalThis.location.origin` is `localhost`/meaningless), otherwise
|
|
153
|
+
* falls back to the browser's own origin. Either source is parsed as a URL
|
|
154
|
+
* and accepted only when it is a well-formed `http(s)` origin — anything else
|
|
155
|
+
* (`javascript:`, an opaque/malformed string, a non-`http(s)` scheme) is
|
|
156
|
+
* rejected and yields an empty string rather than being forwarded.
|
|
157
|
+
*/
|
|
158
|
+
private resolveHostOrigin;
|
|
140
159
|
private buildIframeUrlSearchParams;
|
|
141
160
|
/**
|
|
142
161
|
* Build the URL that the transport provider should load.
|
|
@@ -224,6 +243,39 @@ export declare class IframeManager {
|
|
|
224
243
|
iframeDisplay: iframeMessageHandler;
|
|
225
244
|
cleanup: () => void;
|
|
226
245
|
}>;
|
|
246
|
+
/**
|
|
247
|
+
* Drives the handshake load for a caller-provided {@link WaasSDKContainer}
|
|
248
|
+
* used as a *visible* private-key display surface (e.g. a React Native native
|
|
249
|
+
* WebView). Resolves once the container reports the
|
|
250
|
+
* `iframe-ready-${instanceId}` handshake; rejects on a container-level error
|
|
251
|
+
* or load timeout.
|
|
252
|
+
*
|
|
253
|
+
* Unlike {@link loadIframe}, this deliberately does NOT touch the shared
|
|
254
|
+
* signing container or its retry/static state: the display container is owned
|
|
255
|
+
* by the caller, lives only for the duration of a single export ceremony, and
|
|
256
|
+
* renders the key inside its own sandboxed document. The key is therefore
|
|
257
|
+
* never sent back across the bridge to the host — keeping the
|
|
258
|
+
* "host cannot read the key" invariant identical to the web iframe path.
|
|
259
|
+
*/
|
|
260
|
+
private loadWaasSDKContainerForDisplay;
|
|
261
|
+
/**
|
|
262
|
+
* Initializes a private-key display surface backed by a caller-provided
|
|
263
|
+
* {@link WaasSDKContainer} (e.g. a visible React Native WebView) instead of a
|
|
264
|
+
* DOM {@link HTMLElement}. This is the container-based counterpart to
|
|
265
|
+
* {@link initializeIframeDisplayForContainer}: it reuses the same
|
|
266
|
+
* {@link setupWaasSDKContainerBridge} transport wiring the signing flow uses,
|
|
267
|
+
* so the export ceremony runs — and the key is rendered — entirely inside the
|
|
268
|
+
* container's own sandboxed document.
|
|
269
|
+
*
|
|
270
|
+
* The caller owns the container's mount/visibility. The returned `cleanup`
|
|
271
|
+
* detaches the transport bridge and calls `container.destroy()`.
|
|
272
|
+
*/
|
|
273
|
+
initializeDisplayForWaasSDKContainer({ waasSDKContainer }: {
|
|
274
|
+
waasSDKContainer: WaasSDKContainer;
|
|
275
|
+
}): Promise<{
|
|
276
|
+
iframeDisplay: iframeMessageHandler;
|
|
277
|
+
cleanup: () => void;
|
|
278
|
+
}>;
|
|
227
279
|
cleanup(): Promise<void>;
|
|
228
280
|
}
|
|
229
281
|
//# sourceMappingURL=IframeManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IframeManager.d.ts","sourceRoot":"","sources":["../../../src/client/iframeManager/IframeManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGR,KAAK,sBAAsB,EAK3B,KAAK,qBAAqB,EAG1B,KAAK,oBAAoB,
|
|
1
|
+
{"version":3,"file":"IframeManager.d.ts","sourceRoot":"","sources":["../../../src/client/iframeManager/IframeManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGR,KAAK,sBAAsB,EAK3B,KAAK,qBAAqB,EAG1B,KAAK,oBAAoB,EAEzB,KAAK,gBAAgB,EACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAOL,KAAK,iCAAiC,EACtC,KAAK,cAAc,EAEpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAoC9E,qBAAa,aAAa;IACxB,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,MAAM,wCAAU;IACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAQ;IACjC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAQ;IACnC,aAAa,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqB;IAC/C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAuB;IAMhD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAqB;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAClC,SAAS,CAAC,gBAAgB,EAAE,iCAAiC,GAAG,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