@dynamic-labs/legacy-client 0.0.0 → 5.1.0
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/CHANGELOG.md +6821 -0
- package/LICENSE +21 -0
- package/README.md +3 -0
- package/_virtual/_tslib.cjs +36 -0
- package/_virtual/_tslib.js +32 -0
- package/package.cjs +8 -0
- package/package.js +4 -0
- package/package.json +33 -1
- package/src/client/client.cjs +80 -0
- package/src/client/client.d.ts +108 -0
- package/src/client/client.js +75 -0
- package/src/client/core/core.cjs +84 -0
- package/src/client/core/core.d.ts +75 -0
- package/src/client/core/core.js +80 -0
- package/src/client/core/index.d.ts +1 -0
- package/src/client/core/modules/initializationModule/index.d.ts +1 -0
- package/src/client/core/modules/initializationModule/initializationModule.cjs +72 -0
- package/src/client/core/modules/initializationModule/initializationModule.d.ts +6 -0
- package/src/client/core/modules/initializationModule/initializationModule.js +68 -0
- package/src/client/core/modules/manifestModule/createPartialManifest/createPartialManifest.cjs +28 -0
- package/src/client/core/modules/manifestModule/createPartialManifest/createPartialManifest.d.ts +3 -0
- package/src/client/core/modules/manifestModule/createPartialManifest/createPartialManifest.js +24 -0
- package/src/client/core/modules/manifestModule/createPartialManifest/index.d.ts +1 -0
- package/src/client/core/modules/manifestModule/index.d.ts +1 -0
- package/src/client/core/modules/manifestModule/manifestModule.cjs +40 -0
- package/src/client/core/modules/manifestModule/manifestModule.d.ts +12 -0
- package/src/client/core/modules/manifestModule/manifestModule.js +36 -0
- package/src/client/core/modules/manifestModule/validateManifest/index.d.ts +1 -0
- package/src/client/core/modules/manifestModule/validateManifest/validateManifest.cjs +31 -0
- package/src/client/core/modules/manifestModule/validateManifest/validateManifest.d.ts +14 -0
- package/src/client/core/modules/manifestModule/validateManifest/validateManifest.js +26 -0
- package/src/client/core/modules/webViewLoadControllerRegistry/index.d.ts +1 -0
- package/src/client/core/modules/webViewLoadControllerRegistry/webViewLoadControllerRegistry.cjs +24 -0
- package/src/client/core/modules/webViewLoadControllerRegistry/webViewLoadControllerRegistry.d.ts +29 -0
- package/src/client/core/modules/webViewLoadControllerRegistry/webViewLoadControllerRegistry.js +20 -0
- package/src/client/index.d.ts +1 -0
- package/src/index.cjs +26 -0
- package/src/index.d.ts +14 -0
- package/src/index.js +14 -0
- package/src/modules/authModule/authModule.cjs +60 -0
- package/src/modules/authModule/authModule.d.ts +30 -0
- package/src/modules/authModule/authModule.js +56 -0
- package/src/modules/authModule/emailAuthModule/emailAuthModule.cjs +26 -0
- package/src/modules/authModule/emailAuthModule/emailAuthModule.d.ts +10 -0
- package/src/modules/authModule/emailAuthModule/emailAuthModule.js +22 -0
- package/src/modules/authModule/emailAuthModule/index.d.ts +1 -0
- package/src/modules/authModule/externalAuthModule/externalAuthModule.cjs +16 -0
- package/src/modules/authModule/externalAuthModule/externalAuthModule.d.ts +7 -0
- package/src/modules/authModule/externalAuthModule/externalAuthModule.js +12 -0
- package/src/modules/authModule/externalAuthModule/index.d.ts +1 -0
- package/src/modules/authModule/index.d.ts +1 -0
- package/src/modules/authModule/passkeyAuthModule/index.d.ts +1 -0
- package/src/modules/authModule/passkeyAuthModule/passkeyAuthModule.cjs +15 -0
- package/src/modules/authModule/passkeyAuthModule/passkeyAuthModule.d.ts +6 -0
- package/src/modules/authModule/passkeyAuthModule/passkeyAuthModule.js +11 -0
- package/src/modules/authModule/smsAuthModule/index.d.ts +1 -0
- package/src/modules/authModule/smsAuthModule/smsAuthModule.cjs +23 -0
- package/src/modules/authModule/smsAuthModule/smsAuthModule.d.ts +11 -0
- package/src/modules/authModule/smsAuthModule/smsAuthModule.js +19 -0
- package/src/modules/authModule/socialAuthModule/index.d.ts +1 -0
- package/src/modules/authModule/socialAuthModule/socialAuthModule.cjs +24 -0
- package/src/modules/authModule/socialAuthModule/socialAuthModule.d.ts +10 -0
- package/src/modules/authModule/socialAuthModule/socialAuthModule.js +20 -0
- package/src/modules/bitcoinModule/bitcoinModule.cjs +21 -0
- package/src/modules/bitcoinModule/bitcoinModule.d.ts +19 -0
- package/src/modules/bitcoinModule/bitcoinModule.js +17 -0
- package/src/modules/bitcoinModule/index.d.ts +1 -0
- package/src/modules/deviceRegistrationModule/deviceRegistrationModule.cjs +32 -0
- package/src/modules/deviceRegistrationModule/deviceRegistrationModule.d.ts +12 -0
- package/src/modules/deviceRegistrationModule/deviceRegistrationModule.js +28 -0
- package/src/modules/deviceRegistrationModule/index.d.ts +1 -0
- package/src/modules/instrumentationModule/index.d.ts +1 -0
- package/src/modules/instrumentationModule/instrumentationModule.cjs +40 -0
- package/src/modules/instrumentationModule/instrumentationModule.d.ts +6 -0
- package/src/modules/instrumentationModule/instrumentationModule.js +36 -0
- package/src/modules/localeModule/index.d.ts +1 -0
- package/src/modules/localeModule/localeModule.cjs +15 -0
- package/src/modules/localeModule/localeModule.d.ts +14 -0
- package/src/modules/localeModule/localeModule.js +11 -0
- package/src/modules/mfaModule/index.d.ts +1 -0
- package/src/modules/mfaModule/mfaModule.cjs +35 -0
- package/src/modules/mfaModule/mfaModule.d.ts +23 -0
- package/src/modules/mfaModule/mfaModule.js +31 -0
- package/src/modules/networksModule/index.d.ts +1 -0
- package/src/modules/networksModule/networksModule.cjs +18 -0
- package/src/modules/networksModule/networksModule.d.ts +3 -0
- package/src/modules/networksModule/networksModule.js +14 -0
- package/src/modules/passkeysModule/index.d.ts +1 -0
- package/src/modules/passkeysModule/passkeysModule.cjs +18 -0
- package/src/modules/passkeysModule/passkeysModule.d.ts +10 -0
- package/src/modules/passkeysModule/passkeysModule.js +14 -0
- package/src/modules/sdkModule/index.d.ts +1 -0
- package/src/modules/sdkModule/sdkModule.cjs +64 -0
- package/src/modules/sdkModule/sdkModule.d.ts +25 -0
- package/src/modules/sdkModule/sdkModule.js +60 -0
- package/src/modules/stepUpAuthModule/index.d.ts +1 -0
- package/src/modules/stepUpAuthModule/stepUpAuthModule.cjs +36 -0
- package/src/modules/stepUpAuthModule/stepUpAuthModule.d.ts +19 -0
- package/src/modules/stepUpAuthModule/stepUpAuthModule.js +32 -0
- package/src/modules/tonModule/index.d.ts +1 -0
- package/src/modules/tonModule/tonModule.cjs +19 -0
- package/src/modules/tonModule/tonModule.d.ts +15 -0
- package/src/modules/tonModule/tonModule.js +15 -0
- package/src/modules/userInterfaceModule/index.d.ts +1 -0
- package/src/modules/userInterfaceModule/userInterfaceModule.cjs +66 -0
- package/src/modules/userInterfaceModule/userInterfaceModule.d.ts +155 -0
- package/src/modules/userInterfaceModule/userInterfaceModule.js +62 -0
- package/src/modules/walletsModule/accountAbstractionModule/accountAbstractionModule.cjs +17 -0
- package/src/modules/walletsModule/accountAbstractionModule/accountAbstractionModule.d.ts +14 -0
- package/src/modules/walletsModule/accountAbstractionModule/accountAbstractionModule.js +13 -0
- package/src/modules/walletsModule/accountAbstractionModule/index.d.ts +1 -0
- package/src/modules/walletsModule/createWalletListenerMethods/createWalletListenerMethods.cjs +31 -0
- package/src/modules/walletsModule/createWalletListenerMethods/createWalletListenerMethods.d.ts +9 -0
- package/src/modules/walletsModule/createWalletListenerMethods/createWalletListenerMethods.js +27 -0
- package/src/modules/walletsModule/createWalletListenerMethods/index.d.ts +1 -0
- package/src/modules/walletsModule/delegationModule/delegationModule.cjs +32 -0
- package/src/modules/walletsModule/delegationModule/delegationModule.d.ts +14 -0
- package/src/modules/walletsModule/delegationModule/delegationModule.js +28 -0
- package/src/modules/walletsModule/delegationModule/index.d.ts +1 -0
- package/src/modules/walletsModule/embeddedWalletsModule/embeddedWalletsModule.cjs +32 -0
- package/src/modules/walletsModule/embeddedWalletsModule/embeddedWalletsModule.d.ts +11 -0
- package/src/modules/walletsModule/embeddedWalletsModule/embeddedWalletsModule.js +28 -0
- package/src/modules/walletsModule/embeddedWalletsModule/index.d.ts +1 -0
- package/src/modules/walletsModule/index.d.ts +1 -0
- package/src/modules/walletsModule/phantomModule/index.d.ts +1 -0
- package/src/modules/walletsModule/phantomModule/phantomModule.cjs +18 -0
- package/src/modules/walletsModule/phantomModule/phantomModule.d.ts +27 -0
- package/src/modules/walletsModule/phantomModule/phantomModule.js +14 -0
- package/src/modules/walletsModule/waasModule/index.d.ts +1 -0
- package/src/modules/walletsModule/waasModule/waasModule.cjs +25 -0
- package/src/modules/walletsModule/waasModule/waasModule.d.ts +16 -0
- package/src/modules/walletsModule/waasModule/waasModule.js +21 -0
- package/src/modules/walletsModule/walletsModule.cjs +69 -0
- package/src/modules/walletsModule/walletsModule.d.ts +40 -0
- package/src/modules/walletsModule/walletsModule.js +65 -0
- package/src/types.d.ts +2 -0
- package/src/utils/Extendable/Extendable.cjs +29 -0
- package/src/utils/Extendable/Extendable.d.ts +25 -0
- package/src/utils/Extendable/Extendable.js +25 -0
- package/src/utils/Extendable/deepMerge/deepMergeInto.cjs +26 -0
- package/src/utils/Extendable/deepMerge/deepMergeInto.d.ts +6 -0
- package/src/utils/Extendable/deepMerge/deepMergeInto.js +22 -0
- package/src/utils/Extendable/deepMerge/index.d.ts +1 -0
- package/src/utils/Extendable/hasExtension/hasExtension.cjs +14 -0
- package/src/utils/Extendable/hasExtension/hasExtension.d.ts +9 -0
- package/src/utils/Extendable/hasExtension/hasExtension.js +10 -0
- package/src/utils/Extendable/hasExtension/index.d.ts +1 -0
- package/src/utils/Extendable/index.d.ts +1 -0
- package/src/utils/addProperty/addProperty.cjs +21 -0
- package/src/utils/addProperty/addProperty.d.ts +13 -0
- package/src/utils/addProperty/addProperty.js +17 -0
- package/src/utils/addProperty/index.d.ts +1 -0
- package/src/utils/createWaitForAuthSuccess/createWaitForAuthSuccess.cjs +63 -0
- package/src/utils/createWaitForAuthSuccess/createWaitForAuthSuccess.d.ts +13 -0
- package/src/utils/createWaitForAuthSuccess/createWaitForAuthSuccess.js +59 -0
- package/src/utils/createWaitForAuthSuccess/index.d.ts +1 -0
- package/src/utils/diffMs/diffMs.cjs +12 -0
- package/src/utils/diffMs/diffMs.d.ts +5 -0
- package/src/utils/diffMs/diffMs.js +8 -0
- package/src/utils/diffMs/index.d.ts +1 -0
- package/src/utils/logger/index.d.ts +1 -0
- package/src/utils/logger/logger.cjs +10 -0
- package/src/utils/logger/logger.d.ts +2 -0
- package/src/utils/logger/logger.js +6 -0
- package/src/utils/pickListenerActions/index.d.ts +1 -0
- package/src/utils/pickListenerActions/pickListenerActions.cjs +23 -0
- package/src/utils/pickListenerActions/pickListenerActions.d.ts +7 -0
- package/src/utils/pickListenerActions/pickListenerActions.js +19 -0
- package/src/utils/randomString/index.d.ts +1 -0
- package/src/utils/randomString/randomString.cjs +16 -0
- package/src/utils/randomString/randomString.d.ts +7 -0
- package/src/utils/randomString/randomString.js +12 -0
- package/src/utils/setupFetchHandler/index.d.ts +1 -0
- package/src/utils/setupFetchHandler/setupFetchHandler.cjs +36 -0
- package/src/utils/setupFetchHandler/setupFetchHandler.d.ts +2 -0
- package/src/utils/setupFetchHandler/setupFetchHandler.js +32 -0
- package/src/utils/setupLogHandler/index.d.ts +1 -0
- package/src/utils/setupLogHandler/setupLogHandler.cjs +16 -0
- package/src/utils/setupLogHandler/setupLogHandler.d.ts +2 -0
- package/src/utils/setupLogHandler/setupLogHandler.js +12 -0
- package/src/webviewLoad/WebViewFailedToLoadError/WebViewFailedToLoadError.cjs +13 -0
- package/src/webviewLoad/WebViewFailedToLoadError/WebViewFailedToLoadError.d.ts +110 -0
- package/src/webviewLoad/WebViewFailedToLoadError/WebViewFailedToLoadError.js +9 -0
- package/src/webviewLoad/WebViewFailedToLoadError/index.d.ts +1 -0
- package/src/webviewLoad/assignEnvironmentIdToUrl/assignEnvironmentIdToUrl.cjs +14 -0
- package/src/webviewLoad/assignEnvironmentIdToUrl/assignEnvironmentIdToUrl.d.ts +1 -0
- package/src/webviewLoad/assignEnvironmentIdToUrl/assignEnvironmentIdToUrl.js +10 -0
- package/src/webviewLoad/assignEnvironmentIdToUrl/index.d.ts +1 -0
- package/src/webviewLoad/assignStartTimeToUrl/assignStartTimeToUrl.cjs +13 -0
- package/src/webviewLoad/assignStartTimeToUrl/assignStartTimeToUrl.d.ts +1 -0
- package/src/webviewLoad/assignStartTimeToUrl/assignStartTimeToUrl.js +9 -0
- package/src/webviewLoad/assignStartTimeToUrl/index.d.ts +1 -0
- package/src/webviewLoad/classifyWebViewLoadError/classifyWebViewLoadError.cjs +45 -0
- package/src/webviewLoad/classifyWebViewLoadError/classifyWebViewLoadError.d.ts +26 -0
- package/src/webviewLoad/classifyWebViewLoadError/classifyWebViewLoadError.js +41 -0
- package/src/webviewLoad/classifyWebViewLoadError/constants.cjs +24 -0
- package/src/webviewLoad/classifyWebViewLoadError/constants.d.ts +7 -0
- package/src/webviewLoad/classifyWebViewLoadError/constants.js +16 -0
- package/src/webviewLoad/classifyWebViewLoadError/index.d.ts +2 -0
- package/src/webviewLoad/computeRetryBackoffMs/computeRetryBackoffMs.cjs +24 -0
- package/src/webviewLoad/computeRetryBackoffMs/computeRetryBackoffMs.d.ts +9 -0
- package/src/webviewLoad/computeRetryBackoffMs/computeRetryBackoffMs.js +18 -0
- package/src/webviewLoad/computeRetryBackoffMs/index.d.ts +1 -0
- package/src/webviewLoad/constants.cjs +17 -0
- package/src/webviewLoad/constants.d.ts +4 -0
- package/src/webviewLoad/constants.js +10 -0
- package/src/webviewLoad/createWebViewLoadController/createEmptyAttemptTimings/createEmptyAttemptTimings.cjs +14 -0
- package/src/webviewLoad/createWebViewLoadController/createEmptyAttemptTimings/createEmptyAttemptTimings.d.ts +14 -0
- package/src/webviewLoad/createWebViewLoadController/createEmptyAttemptTimings/createEmptyAttemptTimings.js +10 -0
- package/src/webviewLoad/createWebViewLoadController/createEmptyAttemptTimings/index.d.ts +1 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadController.cjs +288 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadController.d.ts +50 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadController.js +282 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/constants.cjs +45 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/constants.d.ts +29 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/constants.js +37 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/createWebViewLoadTelemetry.cjs +94 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/createWebViewLoadTelemetry.d.ts +38 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/createWebViewLoadTelemetry.js +90 -0
- package/src/webviewLoad/createWebViewLoadController/createWebViewLoadTelemetry/index.d.ts +2 -0
- package/src/webviewLoad/createWebViewLoadController/getPhaseDurations/getPhaseDurations.cjs +20 -0
- package/src/webviewLoad/createWebViewLoadController/getPhaseDurations/getPhaseDurations.d.ts +13 -0
- package/src/webviewLoad/createWebViewLoadController/getPhaseDurations/getPhaseDurations.js +16 -0
- package/src/webviewLoad/createWebViewLoadController/getPhaseDurations/index.d.ts +1 -0
- package/src/webviewLoad/createWebViewLoadController/index.d.ts +3 -0
- package/src/webviewLoad/createWebViewLoadController/recordEventTiming/index.d.ts +1 -0
- package/src/webviewLoad/createWebViewLoadController/recordEventTiming/recordEventTiming.cjs +37 -0
- package/src/webviewLoad/createWebViewLoadController/recordEventTiming/recordEventTiming.d.ts +9 -0
- package/src/webviewLoad/createWebViewLoadController/recordEventTiming/recordEventTiming.js +33 -0
- package/src/webviewLoad/createWebViewLoadController/webViewLoadAdapter/index.d.ts +1 -0
- package/src/webviewLoad/createWebViewLoadController/webViewLoadAdapter/webViewLoadAdapter.d.ts +11 -0
- package/src/webviewLoad/incrementRetryInUrl/incrementRetryInUrl.cjs +17 -0
- package/src/webviewLoad/incrementRetryInUrl/incrementRetryInUrl.d.ts +1 -0
- package/src/webviewLoad/incrementRetryInUrl/incrementRetryInUrl.js +13 -0
- package/src/webviewLoad/incrementRetryInUrl/index.d.ts +1 -0
- package/src/webviewLoad/index.d.ts +14 -0
- package/src/webviewLoad/isRaiseTerminalErrorEffect/index.d.ts +1 -0
- package/src/webviewLoad/isRaiseTerminalErrorEffect/isRaiseTerminalErrorEffect.cjs +8 -0
- package/src/webviewLoad/isRaiseTerminalErrorEffect/isRaiseTerminalErrorEffect.d.ts +13 -0
- package/src/webviewLoad/isRaiseTerminalErrorEffect/isRaiseTerminalErrorEffect.js +4 -0
- package/src/webviewLoad/isSdkReadyMessage/index.d.ts +1 -0
- package/src/webviewLoad/isSdkReadyMessage/isSdkReadyMessage.cjs +27 -0
- package/src/webviewLoad/isSdkReadyMessage/isSdkReadyMessage.d.ts +14 -0
- package/src/webviewLoad/isSdkReadyMessage/isSdkReadyMessage.js +23 -0
- package/src/webviewLoad/probeOrigin/index.d.ts +1 -0
- package/src/webviewLoad/probeOrigin/probeOrigin.cjs +45 -0
- package/src/webviewLoad/probeOrigin/probeOrigin.d.ts +23 -0
- package/src/webviewLoad/probeOrigin/probeOrigin.js +40 -0
- package/src/webviewLoad/sanitizeWebViewLoadOptions/index.d.ts +1 -0
- package/src/webviewLoad/sanitizeWebViewLoadOptions/sanitizeWebViewLoadOptions.cjs +54 -0
- package/src/webviewLoad/sanitizeWebViewLoadOptions/sanitizeWebViewLoadOptions.d.ts +14 -0
- package/src/webviewLoad/sanitizeWebViewLoadOptions/sanitizeWebViewLoadOptions.js +47 -0
- package/src/webviewLoad/sdkWebViewLoadState/index.d.ts +1 -0
- package/src/webviewLoad/sdkWebViewLoadState/sdkWebViewLoadState.cjs +20 -0
- package/src/webviewLoad/sdkWebViewLoadState/sdkWebViewLoadState.d.ts +42 -0
- package/src/webviewLoad/sdkWebViewLoadState/sdkWebViewLoadState.js +16 -0
- package/src/webviewLoad/webViewLoadOptions/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadOptions/webViewLoadOptions.d.ts +45 -0
- package/src/webviewLoad/webViewLoadStateMachine/canAcceptFailureInput/canAcceptFailureInput.cjs +14 -0
- package/src/webviewLoad/webViewLoadStateMachine/canAcceptFailureInput/canAcceptFailureInput.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/canAcceptFailureInput/canAcceptFailureInput.js +10 -0
- package/src/webviewLoad/webViewLoadStateMachine/canAcceptFailureInput/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/constants.cjs +64 -0
- package/src/webviewLoad/webViewLoadStateMachine/constants.d.ts +24 -0
- package/src/webviewLoad/webViewLoadStateMachine/constants.js +37 -0
- package/src/webviewLoad/webViewLoadStateMachine/getHtmlLoadTimeoutMs/getHtmlLoadTimeoutMs.cjs +19 -0
- package/src/webviewLoad/webViewLoadStateMachine/getHtmlLoadTimeoutMs/getHtmlLoadTimeoutMs.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/getHtmlLoadTimeoutMs/getHtmlLoadTimeoutMs.js +15 -0
- package/src/webviewLoad/webViewLoadStateMachine/getHtmlLoadTimeoutMs/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleBackoffElapsed/handleBackoffElapsed.cjs +34 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleBackoffElapsed/handleBackoffElapsed.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleBackoffElapsed/handleBackoffElapsed.js +30 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleBackoffElapsed/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleFailureInput/handleFailureInput.cjs +70 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleFailureInput/handleFailureInput.d.ts +15 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleFailureInput/handleFailureInput.js +66 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleFailureInput/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleLoadRequested/handleLoadRequested.cjs +26 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleLoadRequested/handleLoadRequested.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleLoadRequested/handleLoadRequested.js +22 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleLoadRequested/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleLoadStarted/handleLoadStarted.cjs +28 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleLoadStarted/handleLoadStarted.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleLoadStarted/handleLoadStarted.js +24 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleLoadStarted/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleManifestReceived/handleManifestReceived.cjs +33 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleManifestReceived/handleManifestReceived.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleManifestReceived/handleManifestReceived.js +29 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleManifestReceived/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleNativeError/handleNativeError.cjs +32 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleNativeError/handleNativeError.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleNativeError/handleNativeError.js +28 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleNativeError/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handlePageFinished/handlePageFinished.cjs +25 -0
- package/src/webviewLoad/webViewLoadStateMachine/handlePageFinished/handlePageFinished.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handlePageFinished/handlePageFinished.js +21 -0
- package/src/webviewLoad/webViewLoadStateMachine/handlePageFinished/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleRecoveryRequested/handleRecoveryRequested.cjs +25 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleRecoveryRequested/handleRecoveryRequested.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleRecoveryRequested/handleRecoveryRequested.js +21 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleRecoveryRequested/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleResponseCommitted/handleResponseCommitted.cjs +28 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleResponseCommitted/handleResponseCommitted.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleResponseCommitted/handleResponseCommitted.js +24 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleResponseCommitted/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleRetryRequested/handleRetryRequested.cjs +38 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleRetryRequested/handleRetryRequested.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleRetryRequested/handleRetryRequested.js +34 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleRetryRequested/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleSdkReady/handleSdkReady.cjs +39 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleSdkReady/handleSdkReady.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleSdkReady/handleSdkReady.js +35 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleSdkReady/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleTimerExpired/handleTimerExpired.cjs +23 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleTimerExpired/handleTimerExpired.d.ts +3 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleTimerExpired/handleTimerExpired.js +19 -0
- package/src/webviewLoad/webViewLoadStateMachine/handleTimerExpired/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/index.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/noTransition/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadStateMachine/noTransition/noTransition.cjs +13 -0
- package/src/webviewLoad/webViewLoadStateMachine/noTransition/noTransition.d.ts +2 -0
- package/src/webviewLoad/webViewLoadStateMachine/noTransition/noTransition.js +9 -0
- package/src/webviewLoad/webViewLoadStateMachine/webViewLoadStateMachine.cjs +66 -0
- package/src/webviewLoad/webViewLoadStateMachine/webViewLoadStateMachine.d.ts +9 -0
- package/src/webviewLoad/webViewLoadStateMachine/webViewLoadStateMachine.js +61 -0
- package/src/webviewLoad/webViewLoadTypes/index.d.ts +1 -0
- package/src/webviewLoad/webViewLoadTypes/webViewLoadTypes.d.ts +156 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Dynamic Labs, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
/******************************************************************************
|
|
7
|
+
Copyright (c) Microsoft Corporation.
|
|
8
|
+
|
|
9
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
10
|
+
purpose with or without fee is hereby granted.
|
|
11
|
+
|
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
13
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
14
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
15
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
16
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
17
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
18
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
19
|
+
***************************************************************************** */
|
|
20
|
+
|
|
21
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
32
|
+
var e = new Error(message);
|
|
33
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.__awaiter = __awaiter;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
/******************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */
|
|
16
|
+
|
|
17
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
28
|
+
var e = new Error(message);
|
|
29
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { __awaiter };
|
package/package.cjs
ADDED
package/package.js
ADDED
package/package.json
CHANGED
|
@@ -1 +1,33 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "@dynamic-labs/legacy-client",
|
|
3
|
+
"version": "5.1.0",
|
|
4
|
+
"description": "Core package for utilizing Dynamic's sdk",
|
|
5
|
+
"author": "Dynamic Labs, Inc.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "./src/index.cjs",
|
|
8
|
+
"module": "./src/index.js",
|
|
9
|
+
"types": "./src/index.d.ts",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./src/index.d.ts",
|
|
14
|
+
"import": "./src/index.js",
|
|
15
|
+
"require": "./src/index.cjs"
|
|
16
|
+
},
|
|
17
|
+
"./package.json": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://www.dynamic.xyz/",
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@vue/reactivity": "^3.4.21",
|
|
22
|
+
"@dynamic-labs/sdk-api-core": "0.0.1093",
|
|
23
|
+
"@dynamic-labs/assert-package-version": "5.1.0",
|
|
24
|
+
"@dynamic-labs/locale": "5.1.0",
|
|
25
|
+
"@dynamic-labs/logger": "5.1.0",
|
|
26
|
+
"@dynamic-labs/message-transport": "5.1.0",
|
|
27
|
+
"@dynamic-labs/types": "5.1.0",
|
|
28
|
+
"@dynamic-labs/wallet-connector-core": "5.1.0",
|
|
29
|
+
"@dynamic-labs/webview-messages": "5.1.0",
|
|
30
|
+
"eventemitter3": "5.0.1"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {}
|
|
33
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var logger = require('@dynamic-labs/logger');
|
|
7
|
+
var messageTransport = require('@dynamic-labs/message-transport');
|
|
8
|
+
var authModule = require('../modules/authModule/authModule.cjs');
|
|
9
|
+
var bitcoinModule = require('../modules/bitcoinModule/bitcoinModule.cjs');
|
|
10
|
+
var deviceRegistrationModule = require('../modules/deviceRegistrationModule/deviceRegistrationModule.cjs');
|
|
11
|
+
var instrumentationModule = require('../modules/instrumentationModule/instrumentationModule.cjs');
|
|
12
|
+
var localeModule = require('../modules/localeModule/localeModule.cjs');
|
|
13
|
+
var mfaModule = require('../modules/mfaModule/mfaModule.cjs');
|
|
14
|
+
var networksModule = require('../modules/networksModule/networksModule.cjs');
|
|
15
|
+
var passkeysModule = require('../modules/passkeysModule/passkeysModule.cjs');
|
|
16
|
+
var sdkModule = require('../modules/sdkModule/sdkModule.cjs');
|
|
17
|
+
var stepUpAuthModule = require('../modules/stepUpAuthModule/stepUpAuthModule.cjs');
|
|
18
|
+
var tonModule = require('../modules/tonModule/tonModule.cjs');
|
|
19
|
+
var userInterfaceModule = require('../modules/userInterfaceModule/userInterfaceModule.cjs');
|
|
20
|
+
var walletsModule = require('../modules/walletsModule/walletsModule.cjs');
|
|
21
|
+
var Extendable = require('../utils/Extendable/Extendable.cjs');
|
|
22
|
+
var setupFetchHandler = require('../utils/setupFetchHandler/setupFetchHandler.cjs');
|
|
23
|
+
var setupLogHandler = require('../utils/setupLogHandler/setupLogHandler.cjs');
|
|
24
|
+
var core = require('./core/core.cjs');
|
|
25
|
+
|
|
26
|
+
const baseClientExtensionName = 'base';
|
|
27
|
+
/**
|
|
28
|
+
* Generates a basic client that allows interacting with Dynamic's SDK, which
|
|
29
|
+
* will be rendered inside a webview.
|
|
30
|
+
*
|
|
31
|
+
* It must be extended with the necessary Extensions that implement the services
|
|
32
|
+
* it will be used for.
|
|
33
|
+
*/
|
|
34
|
+
const createClient = (props) => {
|
|
35
|
+
var _a;
|
|
36
|
+
const instrumentation = instrumentationModule.setupInstrumentationModule(props);
|
|
37
|
+
const core$1 = core.createCore(props);
|
|
38
|
+
instrumentation.trackCore(core$1);
|
|
39
|
+
setupLogHandler.setupLogHandler(core$1);
|
|
40
|
+
setupFetchHandler.setupFetchHandler(core$1);
|
|
41
|
+
const baseExtendable = new Extendable.Extendable(core$1);
|
|
42
|
+
const client = baseExtendable.extend(() => {
|
|
43
|
+
core$1.declaredExtensionNames.push(baseClientExtensionName);
|
|
44
|
+
return {
|
|
45
|
+
/** Module that gives access over authentication state, such as the auth token and user */
|
|
46
|
+
auth: authModule.createAuthModule(core$1),
|
|
47
|
+
/** Module for Bitcoin-specific operations (sign, PSBT, send, balance) */
|
|
48
|
+
bitcoin: bitcoinModule.createBitcoinModule(core$1),
|
|
49
|
+
/** Module that provides access to device registration features */
|
|
50
|
+
deviceRegistration: deviceRegistrationModule.createDeviceRegistrationModule(core$1),
|
|
51
|
+
/** Module that provides locale/translation features */
|
|
52
|
+
locale: localeModule.createLocaleModule(core$1),
|
|
53
|
+
/** Module that provides access to MFA features */
|
|
54
|
+
mfa: mfaModule.createMfaModule(core$1),
|
|
55
|
+
/** Module that provides all the networks configured */
|
|
56
|
+
networks: networksModule.createNetworksModule(core$1),
|
|
57
|
+
/** Module that provides access to passkeys */
|
|
58
|
+
passkeys: passkeysModule.createPasskeysModule(core$1),
|
|
59
|
+
/** Module that gives insight over the state of the SDK */
|
|
60
|
+
sdk: sdkModule.createSdkModule(core$1),
|
|
61
|
+
/** Module that provides access to step-up authentication features */
|
|
62
|
+
stepUpAuth: stepUpAuthModule.createStepUpAuthModule(core$1),
|
|
63
|
+
/** Module for TON-specific operations (sign, send TON, Jettons, balance, network) */
|
|
64
|
+
ton: tonModule.createTonModule(core$1),
|
|
65
|
+
/** Module that provide access to UI features */
|
|
66
|
+
ui: userInterfaceModule.createUserInterfaceModule(core$1),
|
|
67
|
+
/** Module that provides access to user's wallets */
|
|
68
|
+
wallets: walletsModule.createWalletsModule(core$1),
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
instrumentation.trackClient(client);
|
|
72
|
+
if ((_a = props.debug) === null || _a === void 0 ? void 0 : _a.messageTransport) {
|
|
73
|
+
messageTransport.setGlobalDebugEnabled(true);
|
|
74
|
+
logger.Logger.troubleshootModeEnabled = true;
|
|
75
|
+
}
|
|
76
|
+
return client;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
exports.baseClientExtensionName = baseClientExtensionName;
|
|
80
|
+
exports.createClient = createClient;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { EvmNetwork, GenericNetwork } from '@dynamic-labs/types';
|
|
2
|
+
import { ClientManifest } from '@dynamic-labs/webview-messages';
|
|
3
|
+
import { Extendable } from '../utils/Extendable';
|
|
4
|
+
export declare const baseClientExtensionName = "base";
|
|
5
|
+
export type BaseClient = ReturnType<typeof createClient>;
|
|
6
|
+
export type ClientProps = {
|
|
7
|
+
environmentId: string;
|
|
8
|
+
apiBaseUrl?: string;
|
|
9
|
+
appName?: string;
|
|
10
|
+
appLogoUrl?: string;
|
|
11
|
+
cssOverrides?: string;
|
|
12
|
+
evmNetworks?: EvmNetwork[];
|
|
13
|
+
/**
|
|
14
|
+
* Overrides for Bitcoin networks. When provided, merges with the dashboard
|
|
15
|
+
* networks (custom entries win on chainId conflicts).
|
|
16
|
+
*/
|
|
17
|
+
bitcoinNetworks?: GenericNetwork[];
|
|
18
|
+
/**
|
|
19
|
+
* Overrides for Solana networks. See `bitcoinNetworks` for merge semantics.
|
|
20
|
+
*/
|
|
21
|
+
solNetworks?: GenericNetwork[];
|
|
22
|
+
/**
|
|
23
|
+
* Overrides for TON networks. See `bitcoinNetworks` for merge semantics.
|
|
24
|
+
*/
|
|
25
|
+
tonNetworks?: GenericNetwork[];
|
|
26
|
+
debug?: ClientManifest['debug'];
|
|
27
|
+
globalWallets?: ClientManifest['globalWallets'];
|
|
28
|
+
locale?: ClientManifest['locale'];
|
|
29
|
+
/**
|
|
30
|
+
* If true, enables connect-only mode where users can connect wallets
|
|
31
|
+
* without signing a message. This is useful for React Native apps where
|
|
32
|
+
* you want to allow wallet connections without full authentication.
|
|
33
|
+
*/
|
|
34
|
+
connectOnly?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Controls the device registration modal behavior.
|
|
37
|
+
* When set to { enabled: false }, the SDK will not automatically show the
|
|
38
|
+
* device registration modal.
|
|
39
|
+
* @default { enabled: true }
|
|
40
|
+
*/
|
|
41
|
+
deviceRegistrationModal?: {
|
|
42
|
+
enabled: boolean;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Controls the legacy embedded wallet migration modal behavior.
|
|
46
|
+
* When set to { autoOpen: false }, the SDK will not automatically open the
|
|
47
|
+
* forced migration modal when a legacy Turnkey wallet is detected on a
|
|
48
|
+
* project whose default wallet version is V3. Headless consumers that build
|
|
49
|
+
* their own migration UI (and call
|
|
50
|
+
* `client.wallets.embedded.upgradeToDynamicWaas`) should disable it.
|
|
51
|
+
* @default { autoOpen: true }
|
|
52
|
+
*/
|
|
53
|
+
legacyWalletMigrationModal?: {
|
|
54
|
+
autoOpen: boolean;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* If true, use MetaMask SDK for MetaMask connections.
|
|
58
|
+
* If false, use WalletConnect for MetaMask connections.
|
|
59
|
+
* Only applies to mobile platforms (React Native, Flutter, Swift).
|
|
60
|
+
* @default true
|
|
61
|
+
*/
|
|
62
|
+
useMetamaskSdk?: boolean;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Generates a basic client that allows interacting with Dynamic's SDK, which
|
|
66
|
+
* will be rendered inside a webview.
|
|
67
|
+
*
|
|
68
|
+
* It must be extended with the necessary Extensions that implement the services
|
|
69
|
+
* it will be used for.
|
|
70
|
+
*/
|
|
71
|
+
export declare const createClient: (props: ClientProps) => {
|
|
72
|
+
/** Module that gives access over authentication state, such as the auth token and user */
|
|
73
|
+
auth: import("../modules/authModule").AuthModule;
|
|
74
|
+
/** Module for Bitcoin-specific operations (sign, PSBT, send, balance) */
|
|
75
|
+
bitcoin: import("../modules/bitcoinModule").BitcoinModule;
|
|
76
|
+
/** Module that provides access to device registration features */
|
|
77
|
+
deviceRegistration: import("../modules/deviceRegistrationModule").DeviceRegistrationModule;
|
|
78
|
+
/** Module that provides locale/translation features */
|
|
79
|
+
locale: {
|
|
80
|
+
changeLanguage: (lang: import("dist/packages/locale/src").Lang) => Promise<void>;
|
|
81
|
+
};
|
|
82
|
+
/** Module that provides access to MFA features */
|
|
83
|
+
mfa: import("../modules/mfaModule").MfaModule;
|
|
84
|
+
/** Module that provides all the networks configured */
|
|
85
|
+
networks: import("@dynamic-labs/message-transport").StoreStateGetters<import("@dynamic-labs/webview-messages").NetworksModuleState> & import("@dynamic-labs/message-transport").PickedEventListeners<import("@dynamic-labs/message-transport").StoreStateEvents<import("@dynamic-labs/webview-messages").NetworksModuleState>>;
|
|
86
|
+
/** Module that provides access to passkeys */
|
|
87
|
+
passkeys: {
|
|
88
|
+
authenticateMFA: (props?: {
|
|
89
|
+
createMfaToken?: import("@dynamic-labs/sdk-api-core").CreateMfaToken | undefined;
|
|
90
|
+
relatedOriginRpId?: string | undefined;
|
|
91
|
+
} | undefined) => Promise<import("@dynamic-labs/sdk-api-core").VerifyResponse>;
|
|
92
|
+
delete: (props: {
|
|
93
|
+
passkeyId: string;
|
|
94
|
+
}) => Promise<void>;
|
|
95
|
+
get: () => Promise<import("@dynamic-labs/sdk-api-core").UserPasskey[]>;
|
|
96
|
+
register: () => Promise<import("@dynamic-labs/sdk-api-core").VerifyResponse>;
|
|
97
|
+
};
|
|
98
|
+
/** Module that gives insight over the state of the SDK */
|
|
99
|
+
sdk: import("../modules/sdkModule").SdkModule;
|
|
100
|
+
/** Module that provides access to step-up authentication features */
|
|
101
|
+
stepUpAuth: import("../modules/stepUpAuthModule").StepUpAuthModule;
|
|
102
|
+
/** Module for TON-specific operations (sign, send TON, Jettons, balance, network) */
|
|
103
|
+
ton: import("../modules/tonModule").TonModule;
|
|
104
|
+
/** Module that provide access to UI features */
|
|
105
|
+
ui: import("../modules/userInterfaceModule/userInterfaceModule").UserInterfaceModule;
|
|
106
|
+
/** Module that provides access to user's wallets */
|
|
107
|
+
wallets: import("../modules/walletsModule").WalletsModule;
|
|
108
|
+
} & Extendable;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { Logger } from '@dynamic-labs/logger';
|
|
3
|
+
import { setGlobalDebugEnabled } from '@dynamic-labs/message-transport';
|
|
4
|
+
import { createAuthModule } from '../modules/authModule/authModule.js';
|
|
5
|
+
import { createBitcoinModule } from '../modules/bitcoinModule/bitcoinModule.js';
|
|
6
|
+
import { createDeviceRegistrationModule } from '../modules/deviceRegistrationModule/deviceRegistrationModule.js';
|
|
7
|
+
import { setupInstrumentationModule } from '../modules/instrumentationModule/instrumentationModule.js';
|
|
8
|
+
import { createLocaleModule } from '../modules/localeModule/localeModule.js';
|
|
9
|
+
import { createMfaModule } from '../modules/mfaModule/mfaModule.js';
|
|
10
|
+
import { createNetworksModule } from '../modules/networksModule/networksModule.js';
|
|
11
|
+
import { createPasskeysModule } from '../modules/passkeysModule/passkeysModule.js';
|
|
12
|
+
import { createSdkModule } from '../modules/sdkModule/sdkModule.js';
|
|
13
|
+
import { createStepUpAuthModule } from '../modules/stepUpAuthModule/stepUpAuthModule.js';
|
|
14
|
+
import { createTonModule } from '../modules/tonModule/tonModule.js';
|
|
15
|
+
import { createUserInterfaceModule } from '../modules/userInterfaceModule/userInterfaceModule.js';
|
|
16
|
+
import { createWalletsModule } from '../modules/walletsModule/walletsModule.js';
|
|
17
|
+
import { Extendable } from '../utils/Extendable/Extendable.js';
|
|
18
|
+
import { setupFetchHandler } from '../utils/setupFetchHandler/setupFetchHandler.js';
|
|
19
|
+
import { setupLogHandler } from '../utils/setupLogHandler/setupLogHandler.js';
|
|
20
|
+
import { createCore } from './core/core.js';
|
|
21
|
+
|
|
22
|
+
const baseClientExtensionName = 'base';
|
|
23
|
+
/**
|
|
24
|
+
* Generates a basic client that allows interacting with Dynamic's SDK, which
|
|
25
|
+
* will be rendered inside a webview.
|
|
26
|
+
*
|
|
27
|
+
* It must be extended with the necessary Extensions that implement the services
|
|
28
|
+
* it will be used for.
|
|
29
|
+
*/
|
|
30
|
+
const createClient = (props) => {
|
|
31
|
+
var _a;
|
|
32
|
+
const instrumentation = setupInstrumentationModule(props);
|
|
33
|
+
const core = createCore(props);
|
|
34
|
+
instrumentation.trackCore(core);
|
|
35
|
+
setupLogHandler(core);
|
|
36
|
+
setupFetchHandler(core);
|
|
37
|
+
const baseExtendable = new Extendable(core);
|
|
38
|
+
const client = baseExtendable.extend(() => {
|
|
39
|
+
core.declaredExtensionNames.push(baseClientExtensionName);
|
|
40
|
+
return {
|
|
41
|
+
/** Module that gives access over authentication state, such as the auth token and user */
|
|
42
|
+
auth: createAuthModule(core),
|
|
43
|
+
/** Module for Bitcoin-specific operations (sign, PSBT, send, balance) */
|
|
44
|
+
bitcoin: createBitcoinModule(core),
|
|
45
|
+
/** Module that provides access to device registration features */
|
|
46
|
+
deviceRegistration: createDeviceRegistrationModule(core),
|
|
47
|
+
/** Module that provides locale/translation features */
|
|
48
|
+
locale: createLocaleModule(core),
|
|
49
|
+
/** Module that provides access to MFA features */
|
|
50
|
+
mfa: createMfaModule(core),
|
|
51
|
+
/** Module that provides all the networks configured */
|
|
52
|
+
networks: createNetworksModule(core),
|
|
53
|
+
/** Module that provides access to passkeys */
|
|
54
|
+
passkeys: createPasskeysModule(core),
|
|
55
|
+
/** Module that gives insight over the state of the SDK */
|
|
56
|
+
sdk: createSdkModule(core),
|
|
57
|
+
/** Module that provides access to step-up authentication features */
|
|
58
|
+
stepUpAuth: createStepUpAuthModule(core),
|
|
59
|
+
/** Module for TON-specific operations (sign, send TON, Jettons, balance, network) */
|
|
60
|
+
ton: createTonModule(core),
|
|
61
|
+
/** Module that provide access to UI features */
|
|
62
|
+
ui: createUserInterfaceModule(core),
|
|
63
|
+
/** Module that provides access to user's wallets */
|
|
64
|
+
wallets: createWalletsModule(core),
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
instrumentation.trackClient(client);
|
|
68
|
+
if ((_a = props.debug) === null || _a === void 0 ? void 0 : _a.messageTransport) {
|
|
69
|
+
setGlobalDebugEnabled(true);
|
|
70
|
+
Logger.troubleshootModeEnabled = true;
|
|
71
|
+
}
|
|
72
|
+
return client;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export { baseClientExtensionName, createClient };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var reactivity = require('@vue/reactivity');
|
|
7
|
+
var messageTransport = require('@dynamic-labs/message-transport');
|
|
8
|
+
var webviewMessages = require('@dynamic-labs/webview-messages');
|
|
9
|
+
var randomString = require('../../utils/randomString/randomString.cjs');
|
|
10
|
+
var initializationModule = require('./modules/initializationModule/initializationModule.cjs');
|
|
11
|
+
var manifestModule = require('./modules/manifestModule/manifestModule.cjs');
|
|
12
|
+
var webViewLoadControllerRegistry = require('./modules/webViewLoadControllerRegistry/webViewLoadControllerRegistry.cjs');
|
|
13
|
+
|
|
14
|
+
const createCore = (props) => {
|
|
15
|
+
const messageTransport$1 = messageTransport.applyRecoveryManager({
|
|
16
|
+
messageTransport: messageTransport.applyDefaultMessageOrigin({
|
|
17
|
+
defaultOrigin: 'host',
|
|
18
|
+
messageTransport: messageTransport.makeWaitForInitEvent({
|
|
19
|
+
bypassBlockIf: (message) => message.origin === 'webview',
|
|
20
|
+
initializeMessageType: webviewMessages.sdkHasLoadedEventName,
|
|
21
|
+
messageTransport: messageTransport.applyTransportStamps(messageTransport.createMessageTransport()),
|
|
22
|
+
}),
|
|
23
|
+
}),
|
|
24
|
+
});
|
|
25
|
+
// Uncomment this to easily debug incoming/outgoing messages to webview
|
|
26
|
+
// messageTransport.on((message) =>
|
|
27
|
+
// console.log('message', JSON.stringify(message, null, 2)),
|
|
28
|
+
// );
|
|
29
|
+
const initialization = initializationModule.createInitializationModule(messageTransport$1);
|
|
30
|
+
const webViewLoadControllerRegistry$1 = webViewLoadControllerRegistry.createWebViewLoadControllerRegistry();
|
|
31
|
+
return {
|
|
32
|
+
/**
|
|
33
|
+
* Debug properties
|
|
34
|
+
*/
|
|
35
|
+
debug: props.debug,
|
|
36
|
+
/**
|
|
37
|
+
* Allows an extension to add its name to the list, such that
|
|
38
|
+
* other extensions are able to detect if it is present.
|
|
39
|
+
*
|
|
40
|
+
* Ex: ViemExtension adds "viem" to the list, and WagmiExtension later
|
|
41
|
+
* checks this list and throws an error if it doesn't find "viem" there.
|
|
42
|
+
*/
|
|
43
|
+
declaredExtensionNames: reactivity.reactive([]),
|
|
44
|
+
/**
|
|
45
|
+
* The environment ID of the client
|
|
46
|
+
*/
|
|
47
|
+
environmentId: props.environmentId,
|
|
48
|
+
/**
|
|
49
|
+
* SDK session ID
|
|
50
|
+
*/
|
|
51
|
+
hostSdkSessionId: randomString.randomString({ length: 8 }),
|
|
52
|
+
/**
|
|
53
|
+
* SDK initialization module handles the initialization error
|
|
54
|
+
*/
|
|
55
|
+
initialization,
|
|
56
|
+
/**
|
|
57
|
+
* Manages the manifest of the host
|
|
58
|
+
*/
|
|
59
|
+
manifest: manifestModule.createManifestModule(props, messageTransport$1, initialization),
|
|
60
|
+
/**
|
|
61
|
+
* Message transport that will be used to send and receive messages to the webview.
|
|
62
|
+
* Should preferably be used with createRequestChannel, rather than used directly.
|
|
63
|
+
*
|
|
64
|
+
* Note: Doesn't implement forwarding messages to/from webview yet.
|
|
65
|
+
* The user is expected to extend the client with an Extension that implements that.
|
|
66
|
+
*/
|
|
67
|
+
messageTransport: messageTransport$1,
|
|
68
|
+
/**
|
|
69
|
+
* Registers the webview load controller created by the platform
|
|
70
|
+
* extension. The client (and its modules, e.g. `client.sdk.loadState`)
|
|
71
|
+
* is created before the controller exists, so the controller is handed
|
|
72
|
+
* over through this slot once the extension sets it up.
|
|
73
|
+
*/
|
|
74
|
+
registerWebViewLoadController: webViewLoadControllerRegistry$1.register,
|
|
75
|
+
/**
|
|
76
|
+
* Registration slot for the webview load controller. Modules read the
|
|
77
|
+
* controller lazily via `getController()` and subscribe to
|
|
78
|
+
* `onRegistered` to bridge its events.
|
|
79
|
+
*/
|
|
80
|
+
webViewLoadControllerRegistry: webViewLoadControllerRegistry$1,
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
exports.createCore = createCore;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ClientProps } from '../client';
|
|
2
|
+
/**
|
|
3
|
+
* Holds properties and methods used by client extensions, but that we don't
|
|
4
|
+
* want users to have access to.
|
|
5
|
+
*/
|
|
6
|
+
export type Core = ReturnType<typeof createCore>;
|
|
7
|
+
export declare const createCore: (props: ClientProps) => {
|
|
8
|
+
/**
|
|
9
|
+
* Debug properties
|
|
10
|
+
*/
|
|
11
|
+
debug: {
|
|
12
|
+
webview?: boolean | undefined;
|
|
13
|
+
messageTransport?: boolean | undefined;
|
|
14
|
+
loggerLevel?: import("dist/packages/logger/src").LogLevel | undefined;
|
|
15
|
+
} | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Allows an extension to add its name to the list, such that
|
|
18
|
+
* other extensions are able to detect if it is present.
|
|
19
|
+
*
|
|
20
|
+
* Ex: ViemExtension adds "viem" to the list, and WagmiExtension later
|
|
21
|
+
* checks this list and throws an error if it doesn't find "viem" there.
|
|
22
|
+
*/
|
|
23
|
+
declaredExtensionNames: string[];
|
|
24
|
+
/**
|
|
25
|
+
* The environment ID of the client
|
|
26
|
+
*/
|
|
27
|
+
environmentId: string;
|
|
28
|
+
/**
|
|
29
|
+
* SDK session ID
|
|
30
|
+
*/
|
|
31
|
+
hostSdkSessionId: string;
|
|
32
|
+
/**
|
|
33
|
+
* SDK initialization module handles the initialization error
|
|
34
|
+
*/
|
|
35
|
+
initialization: import("./modules/initializationModule/initializationModule").InitializationModule;
|
|
36
|
+
/**
|
|
37
|
+
* Manages the manifest of the host
|
|
38
|
+
*/
|
|
39
|
+
manifest: {
|
|
40
|
+
setAppOrigin: (appOrigin: string) => string;
|
|
41
|
+
setPlatform: (platform: "browser" | "react-native" | "flutter" | "swift" | "kotlin" | "unity") => void;
|
|
42
|
+
setRedirectUrl: (redirectUrl: string) => string;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Message transport that will be used to send and receive messages to the webview.
|
|
46
|
+
* Should preferably be used with createRequestChannel, rather than used directly.
|
|
47
|
+
*
|
|
48
|
+
* Note: Doesn't implement forwarding messages to/from webview yet.
|
|
49
|
+
* The user is expected to extend the client with an Extension that implements that.
|
|
50
|
+
*/
|
|
51
|
+
messageTransport: import("dist/packages/message-transport/src/messageTransport/decorators/applyRecoveryManager").WithRecoveryManager<import("@dynamic-labs/message-transport").MessageTransport & {
|
|
52
|
+
emit: (message: import("@dynamic-labs/message-transport").MessageTransportData, options?: {
|
|
53
|
+
onEmit?: VoidFunction | undefined;
|
|
54
|
+
} | undefined) => void;
|
|
55
|
+
unblock: () => void;
|
|
56
|
+
block: () => void;
|
|
57
|
+
isBlocked: () => boolean;
|
|
58
|
+
} & {
|
|
59
|
+
defaultOrigin: "webview" | "host";
|
|
60
|
+
emit: (message: import("@dynamic-labs/message-transport").MessageTransportDataOptionalOrigin) => void;
|
|
61
|
+
}>;
|
|
62
|
+
/**
|
|
63
|
+
* Registers the webview load controller created by the platform
|
|
64
|
+
* extension. The client (and its modules, e.g. `client.sdk.loadState`)
|
|
65
|
+
* is created before the controller exists, so the controller is handed
|
|
66
|
+
* over through this slot once the extension sets it up.
|
|
67
|
+
*/
|
|
68
|
+
registerWebViewLoadController: (controller: import("./modules/webViewLoadControllerRegistry").RegisteredWebViewLoadController) => void;
|
|
69
|
+
/**
|
|
70
|
+
* Registration slot for the webview load controller. Modules read the
|
|
71
|
+
* controller lazily via `getController()` and subscribe to
|
|
72
|
+
* `onRegistered` to bridge its events.
|
|
73
|
+
*/
|
|
74
|
+
webViewLoadControllerRegistry: import("./modules/webViewLoadControllerRegistry").WebViewLoadControllerRegistry;
|
|
75
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { reactive } from '@vue/reactivity';
|
|
3
|
+
import { applyRecoveryManager, applyDefaultMessageOrigin, makeWaitForInitEvent, applyTransportStamps, createMessageTransport } from '@dynamic-labs/message-transport';
|
|
4
|
+
import { sdkHasLoadedEventName } from '@dynamic-labs/webview-messages';
|
|
5
|
+
import { randomString } from '../../utils/randomString/randomString.js';
|
|
6
|
+
import { createInitializationModule } from './modules/initializationModule/initializationModule.js';
|
|
7
|
+
import { createManifestModule } from './modules/manifestModule/manifestModule.js';
|
|
8
|
+
import { createWebViewLoadControllerRegistry } from './modules/webViewLoadControllerRegistry/webViewLoadControllerRegistry.js';
|
|
9
|
+
|
|
10
|
+
const createCore = (props) => {
|
|
11
|
+
const messageTransport = applyRecoveryManager({
|
|
12
|
+
messageTransport: applyDefaultMessageOrigin({
|
|
13
|
+
defaultOrigin: 'host',
|
|
14
|
+
messageTransport: makeWaitForInitEvent({
|
|
15
|
+
bypassBlockIf: (message) => message.origin === 'webview',
|
|
16
|
+
initializeMessageType: sdkHasLoadedEventName,
|
|
17
|
+
messageTransport: applyTransportStamps(createMessageTransport()),
|
|
18
|
+
}),
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
21
|
+
// Uncomment this to easily debug incoming/outgoing messages to webview
|
|
22
|
+
// messageTransport.on((message) =>
|
|
23
|
+
// console.log('message', JSON.stringify(message, null, 2)),
|
|
24
|
+
// );
|
|
25
|
+
const initialization = createInitializationModule(messageTransport);
|
|
26
|
+
const webViewLoadControllerRegistry = createWebViewLoadControllerRegistry();
|
|
27
|
+
return {
|
|
28
|
+
/**
|
|
29
|
+
* Debug properties
|
|
30
|
+
*/
|
|
31
|
+
debug: props.debug,
|
|
32
|
+
/**
|
|
33
|
+
* Allows an extension to add its name to the list, such that
|
|
34
|
+
* other extensions are able to detect if it is present.
|
|
35
|
+
*
|
|
36
|
+
* Ex: ViemExtension adds "viem" to the list, and WagmiExtension later
|
|
37
|
+
* checks this list and throws an error if it doesn't find "viem" there.
|
|
38
|
+
*/
|
|
39
|
+
declaredExtensionNames: reactive([]),
|
|
40
|
+
/**
|
|
41
|
+
* The environment ID of the client
|
|
42
|
+
*/
|
|
43
|
+
environmentId: props.environmentId,
|
|
44
|
+
/**
|
|
45
|
+
* SDK session ID
|
|
46
|
+
*/
|
|
47
|
+
hostSdkSessionId: randomString({ length: 8 }),
|
|
48
|
+
/**
|
|
49
|
+
* SDK initialization module handles the initialization error
|
|
50
|
+
*/
|
|
51
|
+
initialization,
|
|
52
|
+
/**
|
|
53
|
+
* Manages the manifest of the host
|
|
54
|
+
*/
|
|
55
|
+
manifest: createManifestModule(props, messageTransport, initialization),
|
|
56
|
+
/**
|
|
57
|
+
* Message transport that will be used to send and receive messages to the webview.
|
|
58
|
+
* Should preferably be used with createRequestChannel, rather than used directly.
|
|
59
|
+
*
|
|
60
|
+
* Note: Doesn't implement forwarding messages to/from webview yet.
|
|
61
|
+
* The user is expected to extend the client with an Extension that implements that.
|
|
62
|
+
*/
|
|
63
|
+
messageTransport,
|
|
64
|
+
/**
|
|
65
|
+
* Registers the webview load controller created by the platform
|
|
66
|
+
* extension. The client (and its modules, e.g. `client.sdk.loadState`)
|
|
67
|
+
* is created before the controller exists, so the controller is handed
|
|
68
|
+
* over through this slot once the extension sets it up.
|
|
69
|
+
*/
|
|
70
|
+
registerWebViewLoadController: webViewLoadControllerRegistry.register,
|
|
71
|
+
/**
|
|
72
|
+
* Registration slot for the webview load controller. Modules read the
|
|
73
|
+
* controller lazily via `getController()` and subscribe to
|
|
74
|
+
* `onRegistered` to bridge its events.
|
|
75
|
+
*/
|
|
76
|
+
webViewLoadControllerRegistry,
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export { createCore };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './core';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createInitializationModule } from './initializationModule';
|