@dynamic-labs-sdk/client 1.22.1 → 1.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{NativeModuleNotLinkedError-C1P6K16j.native.esm.js → NativeModuleNotLinkedError-DLP1hpcM.native.esm.js} +13 -21
- package/dist/NativeModuleNotLinkedError-DLP1hpcM.native.esm.js.map +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/{consumeMfaTokenIfRequiredForAction-NVOBPPQW.esm.js → consumeMfaTokenIfRequiredForAction-D2oiQdpj.esm.js} +2 -2
- package/dist/{consumeMfaTokenIfRequiredForAction-NVOBPPQW.esm.js.map → consumeMfaTokenIfRequiredForAction-D2oiQdpj.esm.js.map} +1 -1
- package/dist/{consumeMfaTokenIfRequiredForAction-D1iSuzzl.cjs → consumeMfaTokenIfRequiredForAction-DJAdtHe3.cjs} +2 -2
- package/dist/{consumeMfaTokenIfRequiredForAction-D1iSuzzl.cjs.map → consumeMfaTokenIfRequiredForAction-DJAdtHe3.cjs.map} +1 -1
- package/dist/core.cjs +8 -7
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +9 -9
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +6 -6
- package/dist/core.native.esm.js.map +1 -1
- package/dist/exports/core.d.ts +2 -0
- package/dist/exports/core.d.ts.map +1 -1
- package/dist/exports/waas.d.ts +2 -0
- package/dist/exports/waas.d.ts.map +1 -1
- package/dist/generated/dependencyCatalog.d.ts +4 -0
- package/dist/generated/dependencyCatalog.d.ts.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-Cn1w40Jn.cjs → getNetworkProviderFromNetworkId-BVP0ghId.cjs} +2 -2
- package/dist/{getNetworkProviderFromNetworkId-Cn1w40Jn.cjs.map → getNetworkProviderFromNetworkId-BVP0ghId.cjs.map} +1 -1
- package/dist/{getNetworkProviderFromNetworkId-W8EeAcf_.native.esm.js → getNetworkProviderFromNetworkId-Bh4_-rhf.native.esm.js} +3 -261
- package/dist/getNetworkProviderFromNetworkId-Bh4_-rhf.native.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-CkKboiVD.esm.js → getNetworkProviderFromNetworkId-OfuaqHXU.esm.js} +6 -6
- package/dist/getNetworkProviderFromNetworkId-OfuaqHXU.esm.js.map +1 -0
- package/dist/{getSignedSessionId-DgEVnuO-.native.esm.js → getSignedSessionId-2jmv21__.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-DgEVnuO-.native.esm.js.map → getSignedSessionId-2jmv21__.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-DjHPdrA_.esm.js → getSignedSessionId-CDEQ6TMC.esm.js} +2 -2
- package/dist/{getSignedSessionId-DjHPdrA_.esm.js.map → getSignedSessionId-CDEQ6TMC.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-DXrCyLJT.cjs → getSignedSessionId-_ZPqzvm5.cjs} +2 -2
- package/dist/{getSignedSessionId-DXrCyLJT.cjs.map → getSignedSessionId-_ZPqzvm5.cjs.map} +1 -1
- package/dist/getWalletProviderByKey-0VBVdu30.native.esm.js +279 -0
- package/dist/getWalletProviderByKey-0VBVdu30.native.esm.js.map +1 -0
- package/dist/{getWalletProviderByKey-BAmDpbgi.esm.js → getWalletProviderByKey-BIHCI8S6.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-BAmDpbgi.esm.js.map → getWalletProviderByKey-BIHCI8S6.esm.js.map} +1 -1
- package/dist/{getWalletProviderByKey-o0urQYPF.cjs → getWalletProviderByKey-F5wxlC_k.cjs} +2 -2
- package/dist/{getWalletProviderByKey-o0urQYPF.cjs.map → getWalletProviderByKey-F5wxlC_k.cjs.map} +1 -1
- package/dist/index.cjs +14 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +17 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +14 -8
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isDynamicWaasEnabled-C0x4cUHe.esm.js → isDynamicWaasEnabled-OlDJAGIi.esm.js} +2 -2
- package/dist/{isDynamicWaasEnabled-C0x4cUHe.esm.js.map → isDynamicWaasEnabled-OlDJAGIi.esm.js.map} +1 -1
- package/dist/{isDynamicWaasEnabled-DQe8Wxd0.cjs → isDynamicWaasEnabled-YigU-EAT.cjs} +2 -2
- package/dist/{isDynamicWaasEnabled-DQe8Wxd0.cjs.map → isDynamicWaasEnabled-YigU-EAT.cjs.map} +1 -1
- package/dist/{isDynamicWaasEnabled-CF-T5TSi.native.esm.js → isDynamicWaasEnabled-cVxCp5BV.native.esm.js} +2 -2
- package/dist/{isDynamicWaasEnabled-CF-T5TSi.native.esm.js.map → isDynamicWaasEnabled-cVxCp5BV.native.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-BK_4B7Gi.esm.js → isMfaRequiredForAction-Bn2HCYvZ.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-BK_4B7Gi.esm.js.map → isMfaRequiredForAction-Bn2HCYvZ.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-BcO-fQ-N.cjs → isMfaRequiredForAction-BtPXuiSY.cjs} +2 -2
- package/dist/{isMfaRequiredForAction-BcO-fQ-N.cjs.map → isMfaRequiredForAction-BtPXuiSY.cjs.map} +1 -1
- package/dist/{isMfaRequiredForAction-Ce0neLQQ.native.esm.js → isMfaRequiredForAction-DjC0wQJ4.native.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-Ce0neLQQ.native.esm.js.map → isMfaRequiredForAction-DjC0wQJ4.native.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-CssbJY_7.esm.js → isUserOnboardingComplete-BCZpska8.native.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-BK7GcrpI.native.esm.js.map → isUserOnboardingComplete-BCZpska8.native.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-B4hlrt5N.cjs → isUserOnboardingComplete-Bi7tw1lk.cjs} +3 -3
- package/dist/{isUserOnboardingComplete-B4hlrt5N.cjs.map → isUserOnboardingComplete-Bi7tw1lk.cjs.map} +1 -1
- package/dist/{isUserOnboardingComplete-BK7GcrpI.native.esm.js → isUserOnboardingComplete-DScTOOg_.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-CssbJY_7.esm.js.map → isUserOnboardingComplete-DScTOOg_.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-BX9JTaOI.native.esm.js → migrateFromFireblocks-7aKNa_3P.native.esm.js} +3 -3
- package/dist/{migrateFromFireblocks-BX9JTaOI.native.esm.js.map → migrateFromFireblocks-7aKNa_3P.native.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-CIE4qLS6.cjs → migrateFromFireblocks-BnHU2AZJ.cjs} +4 -4
- package/dist/{migrateFromFireblocks-CIE4qLS6.cjs.map → migrateFromFireblocks-BnHU2AZJ.cjs.map} +1 -1
- package/dist/{migrateFromFireblocks-Btox03CB.esm.js → migrateFromFireblocks-DkQj3aYU.esm.js} +4 -4
- package/dist/{migrateFromFireblocks-Btox03CB.esm.js.map → migrateFromFireblocks-DkQj3aYU.esm.js.map} +1 -1
- package/dist/modules/apiClient/constants.d.ts +1 -1
- package/dist/modules/apiClient/constants.d.ts.map +1 -1
- package/dist/modules/auth/getActionAuthorizationTokens/getActionAuthorizationTokens.d.ts +29 -0
- package/dist/modules/auth/getActionAuthorizationTokens/getActionAuthorizationTokens.d.ts.map +1 -0
- package/dist/modules/auth/getActionAuthorizationTokens/index.d.ts +2 -0
- package/dist/modules/auth/getActionAuthorizationTokens/index.d.ts.map +1 -0
- package/dist/modules/auth/logoutReason.d.ts +1 -1
- package/dist/modules/auth/logoutReason.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts +7 -2
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts +6 -1
- package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/businessAccounts.constants.d.ts +5 -0
- package/dist/modules/waas/businessAccounts/businessAccounts.constants.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/transferBusinessAccountOwnership/transferBusinessAccountOwnership.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/updateBusinessAccount/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/updateBusinessAccount/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/updateBusinessAccount/updateBusinessAccount.d.ts +26 -0
- package/dist/modules/waas/businessAccounts/updateBusinessAccount/updateBusinessAccount.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/updateBusinessAccountMemberRole/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/updateBusinessAccountMemberRole/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/updateBusinessAccountMemberRole/updateBusinessAccountMemberRole.d.ts +35 -0
- package/dist/modules/waas/businessAccounts/updateBusinessAccountMemberRole/updateBusinessAccountMemberRole.d.ts.map +1 -0
- package/dist/modules/waas/createWaasProvider/createWaasProvider.d.ts.map +1 -1
- package/dist/modules/wallets/verifyWalletAccount/verifyWalletAccount.d.ts +1 -1
- package/dist/modules/wallets/verifyWalletAccountForSignInOrTransfer/verifyWalletAccountForSignInOrTransfer.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/{updateAuthFromVerifyResponse-CK3pAERc.cjs → updateAuthFromVerifyResponse-B2QePeNz.cjs} +12 -26
- package/dist/updateAuthFromVerifyResponse-B2QePeNz.cjs.map +1 -0
- package/dist/{updateAuthFromVerifyResponse-BhILXMm_.esm.js → updateAuthFromVerifyResponse-wHGRunTk.esm.js} +13 -21
- package/dist/updateAuthFromVerifyResponse-wHGRunTk.esm.js.map +1 -0
- package/dist/waas.cjs +127 -30
- package/dist/waas.cjs.map +1 -1
- package/dist/waas.esm.js +128 -33
- package/dist/waas.esm.js.map +1 -1
- package/dist/waas.native.esm.js +127 -32
- package/dist/waas.native.esm.js.map +1 -1
- package/dist/waasCore.cjs +53 -15
- package/dist/waasCore.cjs.map +1 -1
- package/dist/waasCore.esm.js +53 -15
- package/dist/waasCore.esm.js.map +1 -1
- package/dist/waasCore.native.esm.js +52 -14
- package/dist/waasCore.native.esm.js.map +1 -1
- package/package.json +7 -5
- package/dist/NativeModuleNotLinkedError-C1P6K16j.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-CkKboiVD.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-W8EeAcf_.native.esm.js.map +0 -1
- package/dist/getWalletProviderByKey-ClOKL5JG.native.esm.js +0 -20
- package/dist/getWalletProviderByKey-ClOKL5JG.native.esm.js.map +0 -1
- package/dist/updateAuthFromVerifyResponse-BhILXMm_.esm.js.map +0 -1
- package/dist/updateAuthFromVerifyResponse-CK3pAERc.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrateFromFireblocks-BX9JTaOI.native.esm.js","names":["REASON_BY_NATIVE_CODE: Record<string, WebViewLoadFailureReason>","reason: WebViewLoadFailureReason","NativeDynamicWebView","messageHandlers: Array<(data: unknown) => void>","errorHandlers: Array<(error: unknown) => void>","subscription: { remove: () => void } | null","createWaasClient: CreateWaasClient","refreshAuth"],"sources":["../src/errors/NotWaasWalletProviderError.ts","../src/errors/CorruptedKeyShareError.ts","../src/turboModules/NativeDynamicWebView.ts","../src/errors/WebViewLoadFailedError.ts","../src/modules/waas/createWaasClient/translateNativeOpenError.ts","../src/modules/waas/createWaasClient/createNativeWaasSDKContainer.native.ts","../src/modules/waas/createWaasClient/createWaasSDKContainer.native.ts","../src/modules/waas/createWaasClient/createWaasClient.native.ts","../src/modules/waas/getWaasChainNameFromChain/getWaasChainNameFromChain.ts","../src/modules/waas/getWaasWalletProviderFromWalletAccount/getWaasWalletProviderFromWalletAccount.ts","../src/modules/waas/migrateFromFireblocks/migrateFromFireblocks.ts"],"sourcesContent":["import { BaseError } from './base';\n\ntype NotWaasWalletProviderErrorParams = {\n walletProviderKey: string;\n};\n\nexport class NotWaasWalletProviderError extends BaseError {\n constructor({ walletProviderKey }: NotWaasWalletProviderErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_provider_error',\n docsUrl: null,\n name: 'NotWaasWalletProviderError',\n shortMessage: `Wallet provider ${walletProviderKey} is not a Dynamic WaaS wallet provider`,\n });\n }\n}\n","import { BaseError } from './base';\n\ntype CorruptedKeyShareErrorParams = {\n cause?: Error | null;\n};\n\n/**\n * Thrown when a persisted client key share cannot be parsed back into its\n * structured form (e.g. a partially-written or corrupted keychain entry).\n *\n * Surfaced as a typed error rather than swallowed so callers can distinguish\n * \"no key share stored\" (empty result) from \"key share exists but is\n * unreadable\" — the latter must never be silently treated as the former,\n * which could trigger an unintended re-keygen that overwrites recoverable\n * material.\n */\nexport class CorruptedKeyShareError extends BaseError {\n constructor({ cause = null }: CorruptedKeyShareErrorParams = {}) {\n super({\n cause,\n code: 'corrupted_key_share_error',\n details:\n 'The stored client key share could not be parsed. The secure storage entry may be partially written or corrupted.',\n docsUrl: null,\n name: 'CorruptedKeyShareError',\n shortMessage: 'Stored client key share is corrupted and cannot be read.',\n });\n }\n}\n","// This file is a TurboModule spec consumed by React Native codegen.\n// The `interface`, `default export`, and the `react-native` import are hard\n// requirements of the codegen parser and intentionally deviate from the\n// project's conventions. Codegen discovers specs by the `Native*` filename\n// prefix, so this file cannot be renamed to `.native.ts`.\n\nimport { type TurboModule, TurboModuleRegistry } from 'react-native';\nimport type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';\n\nexport interface Spec extends TurboModule {\n addListener(eventName: string): void;\n close(instanceId: string): void;\n /**\n * Creates a WKWebView for the given instanceId and begins loading `url`.\n *\n * Resolves on `didCommit` — i.e. the first byte of a 2xx/3xx HTTP\n * response has been received and content parsing has started. Page-ready\n * (e.g. the hosted iframe's `iframe-ready-*` handshake) is a separate\n * concern and must be observed by the caller via the message bus; this\n * Promise does not wait for it.\n *\n * Rejects with a `code` of `webview_<reason>` where `<reason>` is one of:\n * - `invalid_url` — URL string was not parseable\n * - `no_host_view` — no foreground window to attach the WebView\n * - `http_error` — response status was >= 400 (userInfo contains `DynamicWebViewStatusCode`)\n * - `navigation_failed` — DNS, TLS, connection failure, or post-commit abort\n * - `cancelled` — `close(instanceId)` was called while this open was pending\n * - `instance_busy` — `open` was called for an instanceId that already has an active WebView\n * - `content_process_terminated` — the WKWebView WebContent process died during load\n * - `unsupported` — the device's Android System WebView is too old to support the secure bridge (Android only)\n *\n * rejection codes into typed `WebViewLoadFailedError` instances.\n */\n open(instanceId: string, url: string): Promise<void>;\n removeListeners(count: number): void;\n sendMessage(instanceId: string, data: UnsafeObject): void;\n}\n\n// eslint-disable-next-line import/no-default-export\nexport default TurboModuleRegistry.get<Spec>('DynamicClientWebView');\n","import { BaseError } from './base/BaseError';\n\n/**\n * Discriminator for `WebViewLoadFailedError`. Identifies the specific\n * failure mode so callers can branch on it (e.g. retry on transient\n * navigation failures, abort on invalid URL, treat HTTP errors distinct\n * from network errors).\n */\nexport type WebViewLoadFailureReason =\n | 'invalid_url'\n | 'no_host_view'\n | 'http_error'\n | 'navigation_failed'\n | 'cancelled'\n | 'instance_busy'\n | 'content_process_terminated'\n | 'unsupported';\n\ntype WebViewLoadFailedErrorParams = {\n cause?: Error | null;\n reason: WebViewLoadFailureReason;\n shortMessage: string;\n /** HTTP response status code. Populated only when `reason === 'http_error'`. */\n statusCode?: number;\n /** Underlying OS-level error description (e.g. `NSURLErrorDomain`\n * localizedDescription). Populated for `reason === 'navigation_failed'`. */\n underlyingError?: string;\n};\n\n/**\n * Thrown when `DynamicWebView.open()` (via the WaaS transport provider)\n * fails to establish a usable load. Inspect `reason` to distinguish the\n * failure mode; `statusCode` and `underlyingError` provide structured\n * metadata for the cases that have it.\n */\nexport class WebViewLoadFailedError extends BaseError {\n readonly reason: WebViewLoadFailureReason;\n readonly statusCode: number | undefined;\n readonly underlyingError: string | undefined;\n\n constructor({\n reason,\n shortMessage,\n cause = null,\n statusCode,\n underlyingError,\n }: WebViewLoadFailedErrorParams) {\n super({\n cause,\n code: 'webview_load_failed_error',\n details: underlyingError,\n docsUrl: null,\n name: 'WebViewLoadFailedError',\n shortMessage,\n });\n this.reason = reason;\n this.statusCode = statusCode;\n this.underlyingError = underlyingError;\n }\n}\n","import {\n WebViewLoadFailedError,\n type WebViewLoadFailureReason,\n} from '../../../errors/WebViewLoadFailedError';\n\n// Maps the native-side RCT reject codes (emitted by DynamicWebView.mm) to the\n// JS-level discriminator on `WebViewLoadFailedError`. Keys must stay in sync\n// with the `Reason.*` strings in DynamicWebViewImpl.swift.\nconst REASON_BY_NATIVE_CODE: Record<string, WebViewLoadFailureReason> = {\n webview_cancelled: 'cancelled',\n webview_content_process_terminated: 'content_process_terminated',\n webview_http_error: 'http_error',\n webview_instance_busy: 'instance_busy',\n webview_invalid_url: 'invalid_url',\n webview_navigation_failed: 'navigation_failed',\n webview_no_host_view: 'no_host_view',\n webview_unsupported: 'unsupported',\n};\n\n// React Native serializes the native NSError's userInfo onto the JS Error as\n// `userInfo`. These keys must stay in sync with the `errorStatusCodeKey` /\n// `errorUnderlyingDescriptionKey` constants in DynamicWebViewImpl.swift.\ntype NativeRejection = {\n code?: string;\n message?: string;\n userInfo?: {\n DynamicWebViewStatusCode?: number;\n DynamicWebViewUnderlying?: string;\n };\n};\n\n/**\n * Translates a native `DynamicWebView.open()` rejection into a typed\n * `WebViewLoadFailedError`. Maps the native RCT reject code to the JS-level\n * `WebViewLoadFailureReason` discriminator (falling back to\n * `navigation_failed` for unrecognized codes) and carries through the\n * structured `statusCode` / `underlyingError` metadata.\n *\n * The `reason` it produces is the contract `createWaasSDKContainer` branches\n * on — notably `emitError` swallows `cancelled` because that code is only ever\n * produced by our own `close()` teardown (verified on both the iOS and Android\n * native sides). Keep `REASON_BY_NATIVE_CODE` in sync with the native reject\n * codes so that branching stays correct.\n *\n * @notInstrumented\n */\nexport const translateNativeOpenError = (\n err: unknown\n): WebViewLoadFailedError => {\n const rejection = (err ?? {}) as NativeRejection;\n\n // Must check the KEYS of REASON_BY_NATIVE_CODE (the `webview_*` native\n // codes), not its values (the JS-level reasons) — this is called with the\n // native code, so checking values made every code fall through to\n // `navigation_failed` and silently broke the `cancelled` swallow.\n const isNativeRejectionCode = (\n code: string | undefined\n ): code is keyof typeof REASON_BY_NATIVE_CODE =>\n code != undefined && code in REASON_BY_NATIVE_CODE;\n\n const reason: WebViewLoadFailureReason = isNativeRejectionCode(rejection.code)\n ? REASON_BY_NATIVE_CODE[rejection.code]\n : 'navigation_failed';\n return new WebViewLoadFailedError({\n cause: err instanceof Error ? err : null,\n reason,\n shortMessage:\n rejection.message ?? `DynamicWebView open failed (${reason}).`,\n statusCode: rejection.userInfo?.DynamicWebViewStatusCode,\n underlyingError: rejection.userInfo?.DynamicWebViewUnderlying,\n });\n};\n","import type { WaasSDKContainer } from '@dynamic-labs-wallet/core';\nimport { NativeEventEmitter } from 'react-native';\n\nimport { NativeModuleNotLinkedError } from '../../../errors/NativeModuleNotLinkedError';\nimport NativeDynamicWebView from '../../../turboModules/NativeDynamicWebView';\nimport { translateNativeOpenError } from './translateNativeOpenError';\n\nconst NATIVE_MODULE_NAME = 'DynamicClientWebView';\nconst MESSAGE_EVENT_NAME = 'dynamicBridgeMessage';\n\ntype BridgeEventPayload = {\n data: unknown;\n instanceId: string;\n};\n\n// The instance ID routes bridge messages to the right container, so it must be\n// globally unique. Use a crypto-random UUID (no Math.random) keyed by timestamp\n// for readability across app reloads.\nconst generateInstanceId = (): string =>\n `${Date.now().toString(36)}-${crypto.randomUUID()}`;\n\n/**\n * Creates a React Native `WaasSDKContainer` backed by a hidden, headless native\n * WebView (WKWebView on iOS, `android.webkit.WebView` on Android) hosted by the\n * `DynamicClientWebView` TurboModule. Each invocation returns an isolated\n * container with its own instance ID, native WebView, and message routing.\n *\n * Used for MPC operations (signing, key-share management) where there is\n * nothing for the user to see. The VISIBLE private-key export display is no\n * longer a native overlay — it is rendered by the `ExportPrivateKey` component\n * (`@dynamic-labs-sdk/react-native-embedded-wallet-export`) on top of\n * `react-native-webview`, so it scrolls and positions like any RN view.\n *\n * @notInstrumented\n */\nexport const createNativeWaasSDKContainer = (): WaasSDKContainer => {\n if (!NativeDynamicWebView) {\n throw new NativeModuleNotLinkedError({ moduleName: NATIVE_MODULE_NAME });\n }\n\n const nativeModule = NativeDynamicWebView;\n const instanceId = generateInstanceId();\n // Construct the emitter against the TurboModule itself — on New Arch,\n // `NativeModules[name]` can be a different compatibility-shim object,\n // and binding `addListener`/`removeListeners` on the wrong instance\n // leaves `startObserving` in the native emitter never firing.\n const emitter = new NativeEventEmitter(\n nativeModule as unknown as ConstructorParameters<typeof NativeEventEmitter>[0]\n );\n\n // IframeManager on the WaaS SDK calls `container.onMessage(handler)` twice\n // on the same container — once to wait for the `iframe-ready-*` handshake,\n // and once later from `setupWaasSDKContainerBridge` to forward transport\n // messages. Both handlers need to receive every message, so the container\n // fans out to all registered handlers instead of enforcing single-register.\n const messageHandlers: Array<(data: unknown) => void> = [];\n const errorHandlers: Array<(error: unknown) => void> = [];\n let subscription: { remove: () => void } | null = null;\n let destroyed = false;\n\n const emitError = (err: unknown): void => {\n if (destroyed) return;\n const translated = translateNativeOpenError(err);\n // `cancelled` is only ever produced by our own `close()` teardown path on\n // the native side. Surfacing it via onError would make consumers like\n // IframeManager interpret their own destroy as a load failure and retry\n // against a provider that no longer exists.\n if (translated.reason === 'cancelled') return;\n for (const handler of errorHandlers) {\n handler(translated);\n }\n };\n\n return {\n destroy() {\n if (destroyed) return;\n destroyed = true;\n\n subscription?.remove();\n subscription = null;\n messageHandlers.length = 0;\n errorHandlers.length = 0;\n nativeModule.close(instanceId);\n },\n\n isAlive: () => !destroyed,\n\n // Signature is dictated by the upstream WaasSDKContainer interface.\n // eslint-disable-next-line custom-rules/require-single-object-param\n onError(handler: (error: unknown) => void) {\n errorHandlers.push(handler);\n return () => {\n const index = errorHandlers.indexOf(handler);\n if (index !== -1) errorHandlers.splice(index, 1);\n };\n },\n\n // Signature is dictated by the upstream WaasSDKContainer interface.\n // eslint-disable-next-line custom-rules/require-single-object-param\n onMessage(handler: (data: unknown) => void) {\n messageHandlers.push(handler);\n\n subscription ??= emitter.addListener(\n MESSAGE_EVENT_NAME,\n (payload: BridgeEventPayload) => {\n if (payload.instanceId !== instanceId) return;\n\n for (const fn of messageHandlers) {\n fn(payload.data);\n }\n }\n );\n\n // WaaS client expects onMessage to return an unsubscribe function —\n // used e.g. to tear down the one-shot handshake handler.\n return () => {\n const index = messageHandlers.indexOf(handler);\n if (index !== -1) messageHandlers.splice(index, 1);\n if (messageHandlers.length === 0) {\n subscription?.remove();\n subscription = null;\n }\n };\n },\n\n sendMessage(data: Record<string, unknown>) {\n nativeModule.sendMessage(instanceId, data);\n },\n /**\n * Hands the URL off to the native WebView and resolves immediately.\n *\n * Per the `WaasSDKContainer` contract (see `@dynamic-labs-wallet/core`\n * types), `setUrl` resolves once the URL has been handed off to the\n * container — NOT when the page has finished loading. Load completion is\n * signalled later via the `iframe-ready-*` message on `onMessage`, and\n * navigation failures surface via `onError`. This dispatch-and-forget\n * shape is load-bearing: the WaaS handshake sequencing expects `setUrl` to\n * resolve before the first message arrives, so the native open is\n * intentionally NOT awaited/returned — its rejection (HTTP errors,\n * navigation failures, preflight errors, etc.) is routed through\n * `emitError` instead. Do not change this to `return nativeModule.open(...)`.\n */\n // Signature is dictated by the upstream WaasSDKContainer interface.\n // eslint-disable-next-line custom-rules/require-single-object-param\n async setUrl(url: string) {\n nativeModule.open(instanceId, url).catch(emitError);\n },\n };\n};\n","import type { WaasSDKContainer } from '@dynamic-labs-wallet/core';\n\nimport { createNativeWaasSDKContainer } from './createNativeWaasSDKContainer.native';\n\n/**\n * Creates a React Native `WaasSDKContainer` backed by a hidden, headless native\n * WebView (WKWebView on iOS, `android.webkit.WebView` on Android) hosted by the\n * `DynamicClientWebView` TurboModule. Used for MPC operations (signing, key-share\n * management) where there is nothing for the user to see.\n *\n * For the private-key export display — where the hosted page must render the\n * key for the user — use the `ExportPrivateKey` component from\n * `@dynamic-labs-sdk/react-native-embedded-wallet-export`, which renders the\n * key inside a `react-native-webview` instead of a native overlay.\n *\n * @notInstrumented\n */\nexport const createWaasSDKContainer = (): WaasSDKContainer =>\n createNativeWaasSDKContainer();\n","import type { AuthMode } from '@dynamic-labs-wallet/browser-wallet-client';\nimport { DynamicWalletClient } from '@dynamic-labs-wallet/browser-wallet-client';\nimport type { SecureStorageAdapter } from '@dynamic-labs-wallet/core';\nimport {\n ACCESSIBLE,\n getGenericPassword,\n resetGenericPassword,\n setGenericPassword,\n} from 'react-native-keychain';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { CorruptedKeyShareError } from '../../../errors/CorruptedKeyShareError';\nimport { CLIENT_SDK_NAME } from '../../apiClient/constants';\nimport { isCookieEnabled } from '../../projectSettings/isCookieEnabled';\nimport {\n DEFAULT_WAAS_BASE_API_URL,\n DEFAULT_WAAS_BASE_MPC_RELAY_API_URL,\n} from '../constants';\nimport type { CreateWaasClient } from './createWaasClient.types';\nimport { createWaasSDKContainer } from './createWaasSDKContainer.native';\n\n/**\n * Keychain security options for the client key share. The share is wallet\n * key material that cannot be re-derived locally, so the options are pinned\n * explicitly rather than inherited from `react-native-keychain` defaults\n * (which vary across versions and platforms).\n *\n * `WHEN_UNLOCKED_THIS_DEVICE_ONLY` keeps the share readable only while the\n * device is unlocked, excludes it from iCloud Keychain sync, and prevents it\n * migrating to a new device on encrypted-backup restore. It deliberately does\n * NOT set `accessControl` (e.g. biometry) — reads must not surface a Face ID /\n * passcode prompt, since the share is read on routine wallet operations.\n */\nconst KEY_SHARE_KEYCHAIN_OPTIONS = {\n accessible: ACCESSIBLE.WHEN_UNLOCKED_THIS_DEVICE_ONLY,\n} as const;\n\n/** @notInstrumented */\nexport const createWaasClient: CreateWaasClient = ({ chainName }, client) => {\n const core = getCore(client);\n\n const additionalTrustedOrigins = core.waas?.additionalTrustedOrigins;\n\n // Namespace the keychain service by environment so two environmentIds on the\n // same device (or two dApps that observe the same account) can't collide and\n // mix key shares. The account address alone is not unique across environments.\n const getKeyShareService = (accountAddress: string): string =>\n `${core.environmentId}:${accountAddress}`;\n\n return new DynamicWalletClient(\n {\n authMode: (isCookieEnabled(client) ? 'cookie' : 'header') as AuthMode,\n authToken: client.token || '',\n baseApiUrl: (core.apiBaseUrl || DEFAULT_WAAS_BASE_API_URL).replace(\n '/api/v0',\n ''\n ),\n baseMPCRelayApiUrl:\n client.projectSettings?.sdk.waas?.relayUrl ||\n DEFAULT_WAAS_BASE_MPC_RELAY_API_URL,\n chainName,\n environmentId: core.environmentId,\n // On React Native there is no real `window.location.origin`, so the hosted\n // iframe is told the app's universalLink as its host origin. This must be\n // allowlisted in the environment's CORS/allowed origins, just like a web\n // app's domain. Without it the WaaS server rejects the iframe load (400).\n hostOrigin: core.metadata?.universalLink,\n sdkVersion: `${CLIENT_SDK_NAME}/${core.version}`,\n ...(additionalTrustedOrigins == undefined\n ? {}\n : { additionalTrustedOrigins }),\n ...(core.waas?.loadTimeoutMs == undefined\n ? {}\n : { iframeLoadTimeout: core.waas.loadTimeoutMs }),\n ...(core.waas?.maxLoadRetries == undefined\n ? {}\n : { maxRetryAttempts: core.waas.maxLoadRetries }),\n },\n {\n createWaasSDKContainer,\n // Typed as the upstream SecureStorageAdapter so the key-share method\n // signatures (and the `shares` payload type) stay compiler-enforced\n // against the WaaS SDK contract rather than re-declared locally.\n secureStorage: {\n getClientKeyShare: async (accountAddress) => {\n const result = await getGenericPassword({\n service: getKeyShareService(accountAddress),\n });\n\n if (!result) {\n return [];\n }\n\n // A corrupted or partially-written keychain entry makes JSON.parse\n // throw mid key-share load. Surface a typed error instead of an\n // unhandled rejection so callers can distinguish \"no share stored\"\n // (empty result above) from \"share exists but is unreadable\".\n try {\n return JSON.parse(result.password);\n } catch (cause) {\n throw new CorruptedKeyShareError({\n cause: cause instanceof Error ? cause : null,\n });\n }\n },\n\n removeClientKeyShare: async (accountAddress) => {\n await resetGenericPassword({\n service: getKeyShareService(accountAddress),\n });\n },\n\n setClientKeyShare: async (accountAddress, shares) => {\n await setGenericPassword(accountAddress, JSON.stringify(shares), {\n ...KEY_SHARE_KEYCHAIN_OPTIONS,\n service: getKeyShareService(accountAddress),\n });\n },\n } satisfies SecureStorageAdapter,\n }\n );\n};\n","import type { Chain } from '../../chain';\nimport { CHAINS_INFO_MAP } from '../../wallets/constants';\n\n/** @notInstrumented */\n// eslint-disable-next-line custom-rules/require-single-object-param\nexport const getWaasChainNameFromChain = (chain: Chain): string => {\n return CHAINS_INFO_MAP[chain].waasChainNameOverride || chain;\n};\n","import type { DynamicClient } from '../../../client/types/DynamicClient';\nimport { NotWaasWalletAccountError } from '../../../errors/NotWaasWalletAccountError';\nimport { getWalletProviderFromWalletAccount } from '../../wallets/utils/getWalletProviderFromWalletAccount';\nimport type { WalletAccount } from '../../wallets/walletAccount';\nimport { isWaasWalletProvider } from '../isWaasWalletProvider';\nimport type { WaasWalletProvider } from '../waas.types';\n\ntype GetWalletProviderFromWalletAccountParams = {\n walletAccount: WalletAccount;\n};\n\n/** @notInstrumented */\nexport const getWaasWalletProviderFromWalletAccount = (\n { walletAccount }: GetWalletProviderFromWalletAccountParams,\n client: DynamicClient\n): WaasWalletProvider => {\n const walletProvider = getWalletProviderFromWalletAccount(\n { walletAccount },\n client\n );\n\n if (!isWaasWalletProvider(walletProvider)) {\n throw new NotWaasWalletAccountError({\n walletAddress: walletAccount.address,\n });\n }\n\n return walletProvider;\n};\n","import type { MigrateFromFireblocksResponse } from '@dynamic-labs-wallet/browser-wallet-client';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { NoWalletProviderFoundError } from '../../../errors/NoWalletProviderFoundError';\nimport { NotWaasWalletProviderError } from '../../../errors/NotWaasWalletProviderError';\nimport { refreshAuth } from '../../user/refreshAuth';\nimport { getWalletProviders } from '../../wallets/getWalletProviders';\nimport { DYNAMIC_WAAS_METADATA } from '../constants';\nimport { isWaasWalletProvider } from '../isWaasWalletProvider';\n\ntype MigrateFromFireblocksParams = {\n /**\n * Optional SLIP-0044 coin types per chain name for BIP44 derivation off the\n * Fireblocks takeover xprv (e.g. `{ EVM: 1 }` for Sepolia).\n */\n coinTypes?: Record<string, number>;\n /**\n * The Fireblocks NCW device id whose key material is being migrated.\n */\n deviceId: string;\n /**\n * Required per-chain expected wallet address (the address Fireblocks held). Its\n * keys are the chains migration runs on, and the migration iframe verifies each\n * imported Dynamic address matches the value, so a wrong derivation fails loudly\n * instead of producing an unusable wallet.\n */\n expectedAddresses: Record<string, string>;\n /**\n * The Fireblocks-issued JWT authorizing the takeover.\n */\n jwt: string;\n /**\n * The password that encrypted the legacy Fireblocks NCW device storage.\n */\n password: string;\n /**\n * The serialized Fireblocks NCW device storage (the local key share backup).\n */\n storage: Record<string, string>;\n};\n\n/**\n * Migrates an existing Fireblocks NCW wallet into Dynamic's WaaS infrastructure.\n *\n * Migration is a single cross-chain operation: one call takes over the Fireblocks\n * key material and provisions Dynamic WaaS wallet accounts for every supported\n * chain. Because it is not per-chain, this resolves a single WaaS wallet provider\n * (any registered chain) and delegates the takeover to it.\n *\n * @param params.deviceId - The Fireblocks NCW device id being migrated.\n * @param params.jwt - The Fireblocks-issued JWT authorizing the takeover.\n * @param params.storage - The serialized Fireblocks NCW device storage.\n * @param params.password - The password that encrypted the legacy device storage.\n * @param params.expectedAddresses - Required per-chain expected address; its keys are the chains migration runs on, and each imported address is verified against it.\n * @param [params.coinTypes] - Optional SLIP-0044 coin types per chain name.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise resolving to the per-chain migration results.\n * @notInstrumented\n */\nexport const migrateFromFireblocks = async (\n {\n coinTypes,\n deviceId,\n expectedAddresses,\n jwt,\n password,\n storage,\n }: MigrateFromFireblocksParams,\n client = getDefaultClient()\n): Promise<MigrateFromFireblocksResponse> => {\n const providers = getWalletProviders(client);\n\n if (providers.length === 0) {\n throw new NoWalletProviderFoundError({\n walletProviderKey: DYNAMIC_WAAS_METADATA.displayName,\n });\n }\n\n // Migration is cross-chain, so any registered WaaS provider can drive the\n // takeover. Resolve the first one rather than iterating per chain.\n const waasProvider = providers.find(isWaasWalletProvider);\n\n if (!waasProvider) {\n throw new NotWaasWalletProviderError({\n walletProviderKey: providers[0].key,\n });\n }\n\n const result = await waasProvider.migrateFromFireblocks({\n coinTypes,\n deviceId,\n expectedAddresses,\n jwt,\n password,\n storage,\n });\n\n await refreshAuth(client);\n\n return result;\n};\n"],"mappings":";;;;;;;AAMA,IAAa,6BAAb,cAAgD,UAAU;CACxD,YAAY,EAAE,qBAAuD;AACnE,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,mBAAmB,kBAAkB;GACpD,CAAC;;;;;;;;;;;;;;;;ACEN,IAAa,yBAAb,cAA4C,UAAU;CACpD,YAAY,EAAE,QAAQ,SAAuC,EAAE,EAAE;AAC/D,QAAM;GACJ;GACA,MAAM;GACN,SACE;GACF,SAAS;GACT,MAAM;GACN,cAAc;GACf,CAAC;;;;;;ACaN,mCAAe,oBAAoB,IAAU,uBAAuB;;;;;;;;;;ACJpE,IAAa,yBAAb,cAA4C,UAAU;CACpD,AAAS;CACT,AAAS;CACT,AAAS;CAET,YAAY,EACV,QACA,cACA,QAAQ,MACR,YACA,mBAC+B;AAC/B,QAAM;GACJ;GACA,MAAM;GACN,SAAS;GACT,SAAS;GACT,MAAM;GACN;GACD,CAAC;AACF,OAAK,SAAS;AACd,OAAK,aAAa;AAClB,OAAK,kBAAkB;;;;;;ACjD3B,MAAMA,wBAAkE;CACtE,mBAAmB;CACnB,oCAAoC;CACpC,oBAAoB;CACpB,uBAAuB;CACvB,qBAAqB;CACrB,2BAA2B;CAC3B,sBAAsB;CACtB,qBAAqB;CACtB;;;;;;;;;;;;;;;;AA6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;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,OAAMC,sBAAY,OAAO;AAEzB,QAAO"}
|
|
1
|
+
{"version":3,"file":"migrateFromFireblocks-7aKNa_3P.native.esm.js","names":["REASON_BY_NATIVE_CODE: Record<string, WebViewLoadFailureReason>","reason: WebViewLoadFailureReason","NativeDynamicWebView","messageHandlers: Array<(data: unknown) => void>","errorHandlers: Array<(error: unknown) => void>","subscription: { remove: () => void } | null","createWaasClient: CreateWaasClient","refreshAuth"],"sources":["../src/errors/NotWaasWalletProviderError.ts","../src/errors/CorruptedKeyShareError.ts","../src/turboModules/NativeDynamicWebView.ts","../src/errors/WebViewLoadFailedError.ts","../src/modules/waas/createWaasClient/translateNativeOpenError.ts","../src/modules/waas/createWaasClient/createNativeWaasSDKContainer.native.ts","../src/modules/waas/createWaasClient/createWaasSDKContainer.native.ts","../src/modules/waas/createWaasClient/createWaasClient.native.ts","../src/modules/waas/getWaasChainNameFromChain/getWaasChainNameFromChain.ts","../src/modules/waas/getWaasWalletProviderFromWalletAccount/getWaasWalletProviderFromWalletAccount.ts","../src/modules/waas/migrateFromFireblocks/migrateFromFireblocks.ts"],"sourcesContent":["import { BaseError } from './base';\n\ntype NotWaasWalletProviderErrorParams = {\n walletProviderKey: string;\n};\n\nexport class NotWaasWalletProviderError extends BaseError {\n constructor({ walletProviderKey }: NotWaasWalletProviderErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_provider_error',\n docsUrl: null,\n name: 'NotWaasWalletProviderError',\n shortMessage: `Wallet provider ${walletProviderKey} is not a Dynamic WaaS wallet provider`,\n });\n }\n}\n","import { BaseError } from './base';\n\ntype CorruptedKeyShareErrorParams = {\n cause?: Error | null;\n};\n\n/**\n * Thrown when a persisted client key share cannot be parsed back into its\n * structured form (e.g. a partially-written or corrupted keychain entry).\n *\n * Surfaced as a typed error rather than swallowed so callers can distinguish\n * \"no key share stored\" (empty result) from \"key share exists but is\n * unreadable\" — the latter must never be silently treated as the former,\n * which could trigger an unintended re-keygen that overwrites recoverable\n * material.\n */\nexport class CorruptedKeyShareError extends BaseError {\n constructor({ cause = null }: CorruptedKeyShareErrorParams = {}) {\n super({\n cause,\n code: 'corrupted_key_share_error',\n details:\n 'The stored client key share could not be parsed. The secure storage entry may be partially written or corrupted.',\n docsUrl: null,\n name: 'CorruptedKeyShareError',\n shortMessage: 'Stored client key share is corrupted and cannot be read.',\n });\n }\n}\n","// This file is a TurboModule spec consumed by React Native codegen.\n// The `interface`, `default export`, and the `react-native` import are hard\n// requirements of the codegen parser and intentionally deviate from the\n// project's conventions. Codegen discovers specs by the `Native*` filename\n// prefix, so this file cannot be renamed to `.native.ts`.\n\nimport { type TurboModule, TurboModuleRegistry } from 'react-native';\nimport type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';\n\nexport interface Spec extends TurboModule {\n addListener(eventName: string): void;\n close(instanceId: string): void;\n /**\n * Creates a WKWebView for the given instanceId and begins loading `url`.\n *\n * Resolves on `didCommit` — i.e. the first byte of a 2xx/3xx HTTP\n * response has been received and content parsing has started. Page-ready\n * (e.g. the hosted iframe's `iframe-ready-*` handshake) is a separate\n * concern and must be observed by the caller via the message bus; this\n * Promise does not wait for it.\n *\n * Rejects with a `code` of `webview_<reason>` where `<reason>` is one of:\n * - `invalid_url` — URL string was not parseable\n * - `no_host_view` — no foreground window to attach the WebView\n * - `http_error` — response status was >= 400 (userInfo contains `DynamicWebViewStatusCode`)\n * - `navigation_failed` — DNS, TLS, connection failure, or post-commit abort\n * - `cancelled` — `close(instanceId)` was called while this open was pending\n * - `instance_busy` — `open` was called for an instanceId that already has an active WebView\n * - `content_process_terminated` — the WKWebView WebContent process died during load\n * - `unsupported` — the device's Android System WebView is too old to support the secure bridge (Android only)\n *\n * rejection codes into typed `WebViewLoadFailedError` instances.\n */\n open(instanceId: string, url: string): Promise<void>;\n removeListeners(count: number): void;\n sendMessage(instanceId: string, data: UnsafeObject): void;\n}\n\n// eslint-disable-next-line import/no-default-export\nexport default TurboModuleRegistry.get<Spec>('DynamicClientWebView');\n","import { BaseError } from './base/BaseError';\n\n/**\n * Discriminator for `WebViewLoadFailedError`. Identifies the specific\n * failure mode so callers can branch on it (e.g. retry on transient\n * navigation failures, abort on invalid URL, treat HTTP errors distinct\n * from network errors).\n */\nexport type WebViewLoadFailureReason =\n | 'invalid_url'\n | 'no_host_view'\n | 'http_error'\n | 'navigation_failed'\n | 'cancelled'\n | 'instance_busy'\n | 'content_process_terminated'\n | 'unsupported';\n\ntype WebViewLoadFailedErrorParams = {\n cause?: Error | null;\n reason: WebViewLoadFailureReason;\n shortMessage: string;\n /** HTTP response status code. Populated only when `reason === 'http_error'`. */\n statusCode?: number;\n /** Underlying OS-level error description (e.g. `NSURLErrorDomain`\n * localizedDescription). Populated for `reason === 'navigation_failed'`. */\n underlyingError?: string;\n};\n\n/**\n * Thrown when `DynamicWebView.open()` (via the WaaS transport provider)\n * fails to establish a usable load. Inspect `reason` to distinguish the\n * failure mode; `statusCode` and `underlyingError` provide structured\n * metadata for the cases that have it.\n */\nexport class WebViewLoadFailedError extends BaseError {\n readonly reason: WebViewLoadFailureReason;\n readonly statusCode: number | undefined;\n readonly underlyingError: string | undefined;\n\n constructor({\n reason,\n shortMessage,\n cause = null,\n statusCode,\n underlyingError,\n }: WebViewLoadFailedErrorParams) {\n super({\n cause,\n code: 'webview_load_failed_error',\n details: underlyingError,\n docsUrl: null,\n name: 'WebViewLoadFailedError',\n shortMessage,\n });\n this.reason = reason;\n this.statusCode = statusCode;\n this.underlyingError = underlyingError;\n }\n}\n","import {\n WebViewLoadFailedError,\n type WebViewLoadFailureReason,\n} from '../../../errors/WebViewLoadFailedError';\n\n// Maps the native-side RCT reject codes (emitted by DynamicWebView.mm) to the\n// JS-level discriminator on `WebViewLoadFailedError`. Keys must stay in sync\n// with the `Reason.*` strings in DynamicWebViewImpl.swift.\nconst REASON_BY_NATIVE_CODE: Record<string, WebViewLoadFailureReason> = {\n webview_cancelled: 'cancelled',\n webview_content_process_terminated: 'content_process_terminated',\n webview_http_error: 'http_error',\n webview_instance_busy: 'instance_busy',\n webview_invalid_url: 'invalid_url',\n webview_navigation_failed: 'navigation_failed',\n webview_no_host_view: 'no_host_view',\n webview_unsupported: 'unsupported',\n};\n\n// React Native serializes the native NSError's userInfo onto the JS Error as\n// `userInfo`. These keys must stay in sync with the `errorStatusCodeKey` /\n// `errorUnderlyingDescriptionKey` constants in DynamicWebViewImpl.swift.\ntype NativeRejection = {\n code?: string;\n message?: string;\n userInfo?: {\n DynamicWebViewStatusCode?: number;\n DynamicWebViewUnderlying?: string;\n };\n};\n\n/**\n * Translates a native `DynamicWebView.open()` rejection into a typed\n * `WebViewLoadFailedError`. Maps the native RCT reject code to the JS-level\n * `WebViewLoadFailureReason` discriminator (falling back to\n * `navigation_failed` for unrecognized codes) and carries through the\n * structured `statusCode` / `underlyingError` metadata.\n *\n * The `reason` it produces is the contract `createWaasSDKContainer` branches\n * on — notably `emitError` swallows `cancelled` because that code is only ever\n * produced by our own `close()` teardown (verified on both the iOS and Android\n * native sides). Keep `REASON_BY_NATIVE_CODE` in sync with the native reject\n * codes so that branching stays correct.\n *\n * @notInstrumented\n */\nexport const translateNativeOpenError = (\n err: unknown\n): WebViewLoadFailedError => {\n const rejection = (err ?? {}) as NativeRejection;\n\n // Must check the KEYS of REASON_BY_NATIVE_CODE (the `webview_*` native\n // codes), not its values (the JS-level reasons) — this is called with the\n // native code, so checking values made every code fall through to\n // `navigation_failed` and silently broke the `cancelled` swallow.\n const isNativeRejectionCode = (\n code: string | undefined\n ): code is keyof typeof REASON_BY_NATIVE_CODE =>\n code != undefined && code in REASON_BY_NATIVE_CODE;\n\n const reason: WebViewLoadFailureReason = isNativeRejectionCode(rejection.code)\n ? REASON_BY_NATIVE_CODE[rejection.code]\n : 'navigation_failed';\n return new WebViewLoadFailedError({\n cause: err instanceof Error ? err : null,\n reason,\n shortMessage:\n rejection.message ?? `DynamicWebView open failed (${reason}).`,\n statusCode: rejection.userInfo?.DynamicWebViewStatusCode,\n underlyingError: rejection.userInfo?.DynamicWebViewUnderlying,\n });\n};\n","import type { WaasSDKContainer } from '@dynamic-labs-wallet/core';\nimport { NativeEventEmitter } from 'react-native';\n\nimport { NativeModuleNotLinkedError } from '../../../errors/NativeModuleNotLinkedError';\nimport NativeDynamicWebView from '../../../turboModules/NativeDynamicWebView';\nimport { translateNativeOpenError } from './translateNativeOpenError';\n\nconst NATIVE_MODULE_NAME = 'DynamicClientWebView';\nconst MESSAGE_EVENT_NAME = 'dynamicBridgeMessage';\n\ntype BridgeEventPayload = {\n data: unknown;\n instanceId: string;\n};\n\n// The instance ID routes bridge messages to the right container, so it must be\n// globally unique. Use a crypto-random UUID (no Math.random) keyed by timestamp\n// for readability across app reloads.\nconst generateInstanceId = (): string =>\n `${Date.now().toString(36)}-${crypto.randomUUID()}`;\n\n/**\n * Creates a React Native `WaasSDKContainer` backed by a hidden, headless native\n * WebView (WKWebView on iOS, `android.webkit.WebView` on Android) hosted by the\n * `DynamicClientWebView` TurboModule. Each invocation returns an isolated\n * container with its own instance ID, native WebView, and message routing.\n *\n * Used for MPC operations (signing, key-share management) where there is\n * nothing for the user to see. The VISIBLE private-key export display is no\n * longer a native overlay — it is rendered by the `ExportPrivateKey` component\n * (`@dynamic-labs-sdk/react-native-embedded-wallet-export`) on top of\n * `react-native-webview`, so it scrolls and positions like any RN view.\n *\n * @notInstrumented\n */\nexport const createNativeWaasSDKContainer = (): WaasSDKContainer => {\n if (!NativeDynamicWebView) {\n throw new NativeModuleNotLinkedError({ moduleName: NATIVE_MODULE_NAME });\n }\n\n const nativeModule = NativeDynamicWebView;\n const instanceId = generateInstanceId();\n // Construct the emitter against the TurboModule itself — on New Arch,\n // `NativeModules[name]` can be a different compatibility-shim object,\n // and binding `addListener`/`removeListeners` on the wrong instance\n // leaves `startObserving` in the native emitter never firing.\n const emitter = new NativeEventEmitter(\n nativeModule as unknown as ConstructorParameters<typeof NativeEventEmitter>[0]\n );\n\n // IframeManager on the WaaS SDK calls `container.onMessage(handler)` twice\n // on the same container — once to wait for the `iframe-ready-*` handshake,\n // and once later from `setupWaasSDKContainerBridge` to forward transport\n // messages. Both handlers need to receive every message, so the container\n // fans out to all registered handlers instead of enforcing single-register.\n const messageHandlers: Array<(data: unknown) => void> = [];\n const errorHandlers: Array<(error: unknown) => void> = [];\n let subscription: { remove: () => void } | null = null;\n let destroyed = false;\n\n const emitError = (err: unknown): void => {\n if (destroyed) return;\n const translated = translateNativeOpenError(err);\n // `cancelled` is only ever produced by our own `close()` teardown path on\n // the native side. Surfacing it via onError would make consumers like\n // IframeManager interpret their own destroy as a load failure and retry\n // against a provider that no longer exists.\n if (translated.reason === 'cancelled') return;\n for (const handler of errorHandlers) {\n handler(translated);\n }\n };\n\n return {\n destroy() {\n if (destroyed) return;\n destroyed = true;\n\n subscription?.remove();\n subscription = null;\n messageHandlers.length = 0;\n errorHandlers.length = 0;\n nativeModule.close(instanceId);\n },\n\n isAlive: () => !destroyed,\n\n // Signature is dictated by the upstream WaasSDKContainer interface.\n // eslint-disable-next-line custom-rules/require-single-object-param\n onError(handler: (error: unknown) => void) {\n errorHandlers.push(handler);\n return () => {\n const index = errorHandlers.indexOf(handler);\n if (index !== -1) errorHandlers.splice(index, 1);\n };\n },\n\n // Signature is dictated by the upstream WaasSDKContainer interface.\n // eslint-disable-next-line custom-rules/require-single-object-param\n onMessage(handler: (data: unknown) => void) {\n messageHandlers.push(handler);\n\n subscription ??= emitter.addListener(\n MESSAGE_EVENT_NAME,\n (payload: BridgeEventPayload) => {\n if (payload.instanceId !== instanceId) return;\n\n for (const fn of messageHandlers) {\n fn(payload.data);\n }\n }\n );\n\n // WaaS client expects onMessage to return an unsubscribe function —\n // used e.g. to tear down the one-shot handshake handler.\n return () => {\n const index = messageHandlers.indexOf(handler);\n if (index !== -1) messageHandlers.splice(index, 1);\n if (messageHandlers.length === 0) {\n subscription?.remove();\n subscription = null;\n }\n };\n },\n\n sendMessage(data: Record<string, unknown>) {\n nativeModule.sendMessage(instanceId, data);\n },\n /**\n * Hands the URL off to the native WebView and resolves immediately.\n *\n * Per the `WaasSDKContainer` contract (see `@dynamic-labs-wallet/core`\n * types), `setUrl` resolves once the URL has been handed off to the\n * container — NOT when the page has finished loading. Load completion is\n * signalled later via the `iframe-ready-*` message on `onMessage`, and\n * navigation failures surface via `onError`. This dispatch-and-forget\n * shape is load-bearing: the WaaS handshake sequencing expects `setUrl` to\n * resolve before the first message arrives, so the native open is\n * intentionally NOT awaited/returned — its rejection (HTTP errors,\n * navigation failures, preflight errors, etc.) is routed through\n * `emitError` instead. Do not change this to `return nativeModule.open(...)`.\n */\n // Signature is dictated by the upstream WaasSDKContainer interface.\n // eslint-disable-next-line custom-rules/require-single-object-param\n async setUrl(url: string) {\n nativeModule.open(instanceId, url).catch(emitError);\n },\n };\n};\n","import type { WaasSDKContainer } from '@dynamic-labs-wallet/core';\n\nimport { createNativeWaasSDKContainer } from './createNativeWaasSDKContainer.native';\n\n/**\n * Creates a React Native `WaasSDKContainer` backed by a hidden, headless native\n * WebView (WKWebView on iOS, `android.webkit.WebView` on Android) hosted by the\n * `DynamicClientWebView` TurboModule. Used for MPC operations (signing, key-share\n * management) where there is nothing for the user to see.\n *\n * For the private-key export display — where the hosted page must render the\n * key for the user — use the `ExportPrivateKey` component from\n * `@dynamic-labs-sdk/react-native-embedded-wallet-export`, which renders the\n * key inside a `react-native-webview` instead of a native overlay.\n *\n * @notInstrumented\n */\nexport const createWaasSDKContainer = (): WaasSDKContainer =>\n createNativeWaasSDKContainer();\n","import type { AuthMode } from '@dynamic-labs-wallet/browser-wallet-client';\nimport { DynamicWalletClient } from '@dynamic-labs-wallet/browser-wallet-client';\nimport type { SecureStorageAdapter } from '@dynamic-labs-wallet/core';\nimport {\n ACCESSIBLE,\n getGenericPassword,\n resetGenericPassword,\n setGenericPassword,\n} from 'react-native-keychain';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { CorruptedKeyShareError } from '../../../errors/CorruptedKeyShareError';\nimport { CLIENT_SDK_NAME } from '../../apiClient/constants';\nimport { isCookieEnabled } from '../../projectSettings/isCookieEnabled';\nimport {\n DEFAULT_WAAS_BASE_API_URL,\n DEFAULT_WAAS_BASE_MPC_RELAY_API_URL,\n} from '../constants';\nimport type { CreateWaasClient } from './createWaasClient.types';\nimport { createWaasSDKContainer } from './createWaasSDKContainer.native';\n\n/**\n * Keychain security options for the client key share. The share is wallet\n * key material that cannot be re-derived locally, so the options are pinned\n * explicitly rather than inherited from `react-native-keychain` defaults\n * (which vary across versions and platforms).\n *\n * `WHEN_UNLOCKED_THIS_DEVICE_ONLY` keeps the share readable only while the\n * device is unlocked, excludes it from iCloud Keychain sync, and prevents it\n * migrating to a new device on encrypted-backup restore. It deliberately does\n * NOT set `accessControl` (e.g. biometry) — reads must not surface a Face ID /\n * passcode prompt, since the share is read on routine wallet operations.\n */\nconst KEY_SHARE_KEYCHAIN_OPTIONS = {\n accessible: ACCESSIBLE.WHEN_UNLOCKED_THIS_DEVICE_ONLY,\n} as const;\n\n/** @notInstrumented */\nexport const createWaasClient: CreateWaasClient = ({ chainName }, client) => {\n const core = getCore(client);\n\n const additionalTrustedOrigins = core.waas?.additionalTrustedOrigins;\n\n // Namespace the keychain service by environment so two environmentIds on the\n // same device (or two dApps that observe the same account) can't collide and\n // mix key shares. The account address alone is not unique across environments.\n const getKeyShareService = (accountAddress: string): string =>\n `${core.environmentId}:${accountAddress}`;\n\n return new DynamicWalletClient(\n {\n authMode: (isCookieEnabled(client) ? 'cookie' : 'header') as AuthMode,\n authToken: client.token || '',\n baseApiUrl: (core.apiBaseUrl || DEFAULT_WAAS_BASE_API_URL).replace(\n '/api/v0',\n ''\n ),\n baseMPCRelayApiUrl:\n client.projectSettings?.sdk.waas?.relayUrl ||\n DEFAULT_WAAS_BASE_MPC_RELAY_API_URL,\n chainName,\n environmentId: core.environmentId,\n // On React Native there is no real `window.location.origin`, so the hosted\n // iframe is told the app's universalLink as its host origin. This must be\n // allowlisted in the environment's CORS/allowed origins, just like a web\n // app's domain. Without it the WaaS server rejects the iframe load (400).\n hostOrigin: core.metadata?.universalLink,\n sdkVersion: `${CLIENT_SDK_NAME}/${core.version}`,\n ...(additionalTrustedOrigins == undefined\n ? {}\n : { additionalTrustedOrigins }),\n ...(core.waas?.loadTimeoutMs == undefined\n ? {}\n : { iframeLoadTimeout: core.waas.loadTimeoutMs }),\n ...(core.waas?.maxLoadRetries == undefined\n ? {}\n : { maxRetryAttempts: core.waas.maxLoadRetries }),\n },\n {\n createWaasSDKContainer,\n // Typed as the upstream SecureStorageAdapter so the key-share method\n // signatures (and the `shares` payload type) stay compiler-enforced\n // against the WaaS SDK contract rather than re-declared locally.\n secureStorage: {\n getClientKeyShare: async (accountAddress) => {\n const result = await getGenericPassword({\n service: getKeyShareService(accountAddress),\n });\n\n if (!result) {\n return [];\n }\n\n // A corrupted or partially-written keychain entry makes JSON.parse\n // throw mid key-share load. Surface a typed error instead of an\n // unhandled rejection so callers can distinguish \"no share stored\"\n // (empty result above) from \"share exists but is unreadable\".\n try {\n return JSON.parse(result.password);\n } catch (cause) {\n throw new CorruptedKeyShareError({\n cause: cause instanceof Error ? cause : null,\n });\n }\n },\n\n removeClientKeyShare: async (accountAddress) => {\n await resetGenericPassword({\n service: getKeyShareService(accountAddress),\n });\n },\n\n setClientKeyShare: async (accountAddress, shares) => {\n await setGenericPassword(accountAddress, JSON.stringify(shares), {\n ...KEY_SHARE_KEYCHAIN_OPTIONS,\n service: getKeyShareService(accountAddress),\n });\n },\n } satisfies SecureStorageAdapter,\n }\n );\n};\n","import type { Chain } from '../../chain';\nimport { CHAINS_INFO_MAP } from '../../wallets/constants';\n\n/** @notInstrumented */\n// eslint-disable-next-line custom-rules/require-single-object-param\nexport const getWaasChainNameFromChain = (chain: Chain): string => {\n return CHAINS_INFO_MAP[chain].waasChainNameOverride || chain;\n};\n","import type { DynamicClient } from '../../../client/types/DynamicClient';\nimport { NotWaasWalletAccountError } from '../../../errors/NotWaasWalletAccountError';\nimport { getWalletProviderFromWalletAccount } from '../../wallets/utils/getWalletProviderFromWalletAccount';\nimport type { WalletAccount } from '../../wallets/walletAccount';\nimport { isWaasWalletProvider } from '../isWaasWalletProvider';\nimport type { WaasWalletProvider } from '../waas.types';\n\ntype GetWalletProviderFromWalletAccountParams = {\n walletAccount: WalletAccount;\n};\n\n/** @notInstrumented */\nexport const getWaasWalletProviderFromWalletAccount = (\n { walletAccount }: GetWalletProviderFromWalletAccountParams,\n client: DynamicClient\n): WaasWalletProvider => {\n const walletProvider = getWalletProviderFromWalletAccount(\n { walletAccount },\n client\n );\n\n if (!isWaasWalletProvider(walletProvider)) {\n throw new NotWaasWalletAccountError({\n walletAddress: walletAccount.address,\n });\n }\n\n return walletProvider;\n};\n","import type { MigrateFromFireblocksResponse } from '@dynamic-labs-wallet/browser-wallet-client';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { NoWalletProviderFoundError } from '../../../errors/NoWalletProviderFoundError';\nimport { NotWaasWalletProviderError } from '../../../errors/NotWaasWalletProviderError';\nimport { refreshAuth } from '../../user/refreshAuth';\nimport { getWalletProviders } from '../../wallets/getWalletProviders';\nimport { DYNAMIC_WAAS_METADATA } from '../constants';\nimport { isWaasWalletProvider } from '../isWaasWalletProvider';\n\ntype MigrateFromFireblocksParams = {\n /**\n * Optional SLIP-0044 coin types per chain name for BIP44 derivation off the\n * Fireblocks takeover xprv (e.g. `{ EVM: 1 }` for Sepolia).\n */\n coinTypes?: Record<string, number>;\n /**\n * The Fireblocks NCW device id whose key material is being migrated.\n */\n deviceId: string;\n /**\n * Required per-chain expected wallet address (the address Fireblocks held). Its\n * keys are the chains migration runs on, and the migration iframe verifies each\n * imported Dynamic address matches the value, so a wrong derivation fails loudly\n * instead of producing an unusable wallet.\n */\n expectedAddresses: Record<string, string>;\n /**\n * The Fireblocks-issued JWT authorizing the takeover.\n */\n jwt: string;\n /**\n * The password that encrypted the legacy Fireblocks NCW device storage.\n */\n password: string;\n /**\n * The serialized Fireblocks NCW device storage (the local key share backup).\n */\n storage: Record<string, string>;\n};\n\n/**\n * Migrates an existing Fireblocks NCW wallet into Dynamic's WaaS infrastructure.\n *\n * Migration is a single cross-chain operation: one call takes over the Fireblocks\n * key material and provisions Dynamic WaaS wallet accounts for every supported\n * chain. Because it is not per-chain, this resolves a single WaaS wallet provider\n * (any registered chain) and delegates the takeover to it.\n *\n * @param params.deviceId - The Fireblocks NCW device id being migrated.\n * @param params.jwt - The Fireblocks-issued JWT authorizing the takeover.\n * @param params.storage - The serialized Fireblocks NCW device storage.\n * @param params.password - The password that encrypted the legacy device storage.\n * @param params.expectedAddresses - Required per-chain expected address; its keys are the chains migration runs on, and each imported address is verified against it.\n * @param [params.coinTypes] - Optional SLIP-0044 coin types per chain name.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise resolving to the per-chain migration results.\n * @notInstrumented\n */\nexport const migrateFromFireblocks = async (\n {\n coinTypes,\n deviceId,\n expectedAddresses,\n jwt,\n password,\n storage,\n }: MigrateFromFireblocksParams,\n client = getDefaultClient()\n): Promise<MigrateFromFireblocksResponse> => {\n const providers = getWalletProviders(client);\n\n if (providers.length === 0) {\n throw new NoWalletProviderFoundError({\n walletProviderKey: DYNAMIC_WAAS_METADATA.displayName,\n });\n }\n\n // Migration is cross-chain, so any registered WaaS provider can drive the\n // takeover. Resolve the first one rather than iterating per chain.\n const waasProvider = providers.find(isWaasWalletProvider);\n\n if (!waasProvider) {\n throw new NotWaasWalletProviderError({\n walletProviderKey: providers[0].key,\n });\n }\n\n const result = await waasProvider.migrateFromFireblocks({\n coinTypes,\n deviceId,\n expectedAddresses,\n jwt,\n password,\n storage,\n });\n\n await refreshAuth(client);\n\n return result;\n};\n"],"mappings":";;;;;;;AAMA,IAAa,6BAAb,cAAgD,UAAU;CACxD,YAAY,EAAE,qBAAuD;AACnE,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,mBAAmB,kBAAkB;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F;;;;;;ACnHH,MAAa,6BAA6B,UAAyB;AACjE,QAAO,gBAAgB,OAAO,yBAAyB;;;;;;ACMzD,MAAa,0CACX,EAAE,iBACF,WACuB;CACvB,MAAM,iBAAiB,mCACrB,EAAE,eAAe,EACjB,OACD;AAED,KAAI,CAAC,qBAAqB,eAAe,CACvC,OAAM,IAAI,0BAA0B,EAClC,eAAe,cAAc,SAC9B,CAAC;AAGJ,QAAO;;;;;;;;;;;;;;;;;;;;;;;ACgCT,MAAa,wBAAwB,OACnC,EACE,WACA,UACA,mBACA,KACA,UACA,WAEF,SAAS,kBAAkB,KACgB;CAC3C,MAAM,YAAY,mBAAmB,OAAO;AAE5C,KAAI,UAAU,WAAW,EACvB,OAAM,IAAI,2BAA2B,EACnC,mBAAmB,sBAAsB,aAC1C,CAAC;CAKJ,MAAM,eAAe,UAAU,KAAK,qBAAqB;AAEzD,KAAI,CAAC,aACH,OAAM,IAAI,2BAA2B,EACnC,mBAAmB,UAAU,GAAG,KACjC,CAAC;CAGJ,MAAM,SAAS,MAAM,aAAa,sBAAsB;EACtD;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,OAAMC,sBAAY,OAAO;AAEzB,QAAO"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-
|
|
2
|
-
const require_isDynamicWaasEnabled = require('./isDynamicWaasEnabled-
|
|
3
|
-
const require_getSignedSessionId = require('./getSignedSessionId-
|
|
1
|
+
const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-B2QePeNz.cjs');
|
|
2
|
+
const require_isDynamicWaasEnabled = require('./isDynamicWaasEnabled-YigU-EAT.cjs');
|
|
3
|
+
const require_getSignedSessionId = require('./getSignedSessionId-_ZPqzvm5.cjs');
|
|
4
4
|
let _dynamic_labs_wallet_browser_wallet_client = require("@dynamic-labs-wallet/browser-wallet-client");
|
|
5
5
|
|
|
6
6
|
//#region src/errors/NotWaasWalletProviderError.ts
|
|
@@ -130,4 +130,4 @@ Object.defineProperty(exports, 'migrateFromFireblocks', {
|
|
|
130
130
|
return migrateFromFireblocks;
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
|
-
//# sourceMappingURL=migrateFromFireblocks-
|
|
133
|
+
//# sourceMappingURL=migrateFromFireblocks-BnHU2AZJ.cjs.map
|
package/dist/{migrateFromFireblocks-CIE4qLS6.cjs.map → migrateFromFireblocks-BnHU2AZJ.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrateFromFireblocks-CIE4qLS6.cjs","names":["BaseError","createWaasClient: CreateWaasClient","getCore","DynamicWalletClient","isCookieEnabled","DEFAULT_WAAS_BASE_API_URL","DEFAULT_WAAS_BASE_MPC_RELAY_API_URL","CLIENT_SDK_NAME","getSignedSessionId","logoutWithReason","CHAINS_INFO_MAP","getWalletProviderFromWalletAccount","isWaasWalletProvider","NotWaasWalletAccountError","getDefaultClient","getWalletProviders","NoWalletProviderFoundError","DYNAMIC_WAAS_METADATA","isWaasWalletProvider","refreshAuth"],"sources":["../src/errors/NotWaasWalletProviderError.ts","../src/modules/waas/createWaasClient/createWaasClient.ts","../src/modules/waas/getWaasChainNameFromChain/getWaasChainNameFromChain.ts","../src/modules/waas/getWaasWalletProviderFromWalletAccount/getWaasWalletProviderFromWalletAccount.ts","../src/modules/waas/migrateFromFireblocks/migrateFromFireblocks.ts"],"sourcesContent":["import { BaseError } from './base';\n\ntype NotWaasWalletProviderErrorParams = {\n walletProviderKey: string;\n};\n\nexport class NotWaasWalletProviderError extends BaseError {\n constructor({ walletProviderKey }: NotWaasWalletProviderErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_provider_error',\n docsUrl: null,\n name: 'NotWaasWalletProviderError',\n shortMessage: `Wallet provider ${walletProviderKey} is not a Dynamic WaaS wallet provider`,\n });\n }\n}\n","import type { AuthMode } from '@dynamic-labs-wallet/browser-wallet-client';\nimport { DynamicWalletClient } from '@dynamic-labs-wallet/browser-wallet-client';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { CLIENT_SDK_NAME } from '../../apiClient/constants';\nimport { logoutWithReason } from '../../auth/logoutWithReason';\nimport { isCookieEnabled } from '../../projectSettings/isCookieEnabled';\nimport { getSignedSessionId } from '../../sessionKeys/getSignedSessionId';\nimport type { CreateWaasClient } from './createWaasClient.types';\nimport {\n DEFAULT_WAAS_BASE_API_URL,\n DEFAULT_WAAS_BASE_MPC_RELAY_API_URL,\n} from '../constants';\n\n/** @notInstrumented */\nexport const createWaasClient: CreateWaasClient = ({ chainName }, client) => {\n const core = getCore(client);\n\n const additionalTrustedOrigins = core.waas?.additionalTrustedOrigins;\n\n const baseClientKeysharesRelayApiUrl =\n client.projectSettings?.sdk.waas?.customKeyshareRelayBaseUrl;\n\n return new DynamicWalletClient(\n {\n authMode: (isCookieEnabled(client) ? 'cookie' : 'header') as AuthMode,\n authToken: client.token || '',\n baseApiUrl: (core.apiBaseUrl || DEFAULT_WAAS_BASE_API_URL).replace(\n '/api/v0',\n ''\n ),\n baseMPCRelayApiUrl:\n client.projectSettings?.sdk.waas?.relayUrl ||\n DEFAULT_WAAS_BASE_MPC_RELAY_API_URL,\n chainName,\n // Opt into the SDK self-driving eager key-share recovery on auth-token\n // arrival, so the client no longer restores shares itself on login.\n eagerlyRecoverKeyShares: true,\n environmentId: core.environmentId,\n sdkVersion: `${CLIENT_SDK_NAME}/${core.version}`,\n ...(additionalTrustedOrigins == undefined\n ? {}\n : { additionalTrustedOrigins }),\n ...(baseClientKeysharesRelayApiUrl == undefined\n ? {}\n : { baseClientKeysharesRelayApiUrl }),\n ...(core.waas?.loadTimeoutMs == undefined\n ? {}\n : { iframeLoadTimeout: core.waas.loadTimeoutMs }),\n ...(core.waas?.maxLoadRetries == undefined\n ? {}\n : { maxRetryAttempts: core.waas.maxLoadRetries }),\n },\n {\n // Lets the iframe mint a fresh signed session id over the reverse channel,\n // which the SDK's eager key-share recovery needs.\n getSignedSessionId: () =>\n getSignedSessionId(client).then(({ signature }) => signature),\n // When the WaaS iframe's own backend call returns 401 (e.g. a forcibly\n // revoked token), the iframe notifies the host via the reverse channel\n // and this fires — log the user out. Mirrors the session-expiry\n // middleware that covers the SDK's own direct API 401s.\n onUnauthorized: () => {\n void logoutWithReason(\n { reason: 'session-refresh-unauthorized' },\n client\n ).catch((error) => {\n core.logger.error(\n 'Failed to log out after WaaS unauthorized response',\n error\n );\n });\n },\n }\n );\n};\n","import type { Chain } from '../../chain';\nimport { CHAINS_INFO_MAP } from '../../wallets/constants';\n\n/** @notInstrumented */\n// eslint-disable-next-line custom-rules/require-single-object-param\nexport const getWaasChainNameFromChain = (chain: Chain): string => {\n return CHAINS_INFO_MAP[chain].waasChainNameOverride || chain;\n};\n","import type { DynamicClient } from '../../../client/types/DynamicClient';\nimport { NotWaasWalletAccountError } from '../../../errors/NotWaasWalletAccountError';\nimport { getWalletProviderFromWalletAccount } from '../../wallets/utils/getWalletProviderFromWalletAccount';\nimport type { WalletAccount } from '../../wallets/walletAccount';\nimport { isWaasWalletProvider } from '../isWaasWalletProvider';\nimport type { WaasWalletProvider } from '../waas.types';\n\ntype GetWalletProviderFromWalletAccountParams = {\n walletAccount: WalletAccount;\n};\n\n/** @notInstrumented */\nexport const getWaasWalletProviderFromWalletAccount = (\n { walletAccount }: GetWalletProviderFromWalletAccountParams,\n client: DynamicClient\n): WaasWalletProvider => {\n const walletProvider = getWalletProviderFromWalletAccount(\n { walletAccount },\n client\n );\n\n if (!isWaasWalletProvider(walletProvider)) {\n throw new NotWaasWalletAccountError({\n walletAddress: walletAccount.address,\n });\n }\n\n return walletProvider;\n};\n","import type { MigrateFromFireblocksResponse } from '@dynamic-labs-wallet/browser-wallet-client';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { NoWalletProviderFoundError } from '../../../errors/NoWalletProviderFoundError';\nimport { NotWaasWalletProviderError } from '../../../errors/NotWaasWalletProviderError';\nimport { refreshAuth } from '../../user/refreshAuth';\nimport { getWalletProviders } from '../../wallets/getWalletProviders';\nimport { DYNAMIC_WAAS_METADATA } from '../constants';\nimport { isWaasWalletProvider } from '../isWaasWalletProvider';\n\ntype MigrateFromFireblocksParams = {\n /**\n * Optional SLIP-0044 coin types per chain name for BIP44 derivation off the\n * Fireblocks takeover xprv (e.g. `{ EVM: 1 }` for Sepolia).\n */\n coinTypes?: Record<string, number>;\n /**\n * The Fireblocks NCW device id whose key material is being migrated.\n */\n deviceId: string;\n /**\n * Required per-chain expected wallet address (the address Fireblocks held). Its\n * keys are the chains migration runs on, and the migration iframe verifies each\n * imported Dynamic address matches the value, so a wrong derivation fails loudly\n * instead of producing an unusable wallet.\n */\n expectedAddresses: Record<string, string>;\n /**\n * The Fireblocks-issued JWT authorizing the takeover.\n */\n jwt: string;\n /**\n * The password that encrypted the legacy Fireblocks NCW device storage.\n */\n password: string;\n /**\n * The serialized Fireblocks NCW device storage (the local key share backup).\n */\n storage: Record<string, string>;\n};\n\n/**\n * Migrates an existing Fireblocks NCW wallet into Dynamic's WaaS infrastructure.\n *\n * Migration is a single cross-chain operation: one call takes over the Fireblocks\n * key material and provisions Dynamic WaaS wallet accounts for every supported\n * chain. Because it is not per-chain, this resolves a single WaaS wallet provider\n * (any registered chain) and delegates the takeover to it.\n *\n * @param params.deviceId - The Fireblocks NCW device id being migrated.\n * @param params.jwt - The Fireblocks-issued JWT authorizing the takeover.\n * @param params.storage - The serialized Fireblocks NCW device storage.\n * @param params.password - The password that encrypted the legacy device storage.\n * @param params.expectedAddresses - Required per-chain expected address; its keys are the chains migration runs on, and each imported address is verified against it.\n * @param [params.coinTypes] - Optional SLIP-0044 coin types per chain name.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise resolving to the per-chain migration results.\n * @notInstrumented\n */\nexport const migrateFromFireblocks = async (\n {\n coinTypes,\n deviceId,\n expectedAddresses,\n jwt,\n password,\n storage,\n }: MigrateFromFireblocksParams,\n client = getDefaultClient()\n): Promise<MigrateFromFireblocksResponse> => {\n const providers = getWalletProviders(client);\n\n if (providers.length === 0) {\n throw new NoWalletProviderFoundError({\n walletProviderKey: DYNAMIC_WAAS_METADATA.displayName,\n });\n }\n\n // Migration is cross-chain, so any registered WaaS provider can drive the\n // takeover. Resolve the first one rather than iterating per chain.\n const waasProvider = providers.find(isWaasWalletProvider);\n\n if (!waasProvider) {\n throw new NotWaasWalletProviderError({\n walletProviderKey: providers[0].key,\n });\n }\n\n const result = await waasProvider.migrateFromFireblocks({\n coinTypes,\n deviceId,\n expectedAddresses,\n jwt,\n password,\n storage,\n });\n\n await refreshAuth(client);\n\n return result;\n};\n"],"mappings":";;;;;;AAMA,IAAa,6BAAb,cAAgDA,+CAAU;CACxD,YAAY,EAAE,qBAAuD;AACnE,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,mBAAmB,kBAAkB;GACpD,CAAC;;;;;;;ACCN,MAAaC,oBAAsC,EAAE,aAAa,WAAW;CAC3E,MAAM,OAAOC,6CAAQ,OAAO;CAE5B,MAAM,2BAA2B,KAAK,MAAM;CAE5C,MAAM,iCACJ,OAAO,iBAAiB,IAAI,MAAM;AAEpC,QAAO,IAAIC,+DACT;EACE,UAAWC,qDAAgB,OAAO,GAAG,WAAW;EAChD,WAAW,OAAO,SAAS;EAC3B,aAAa,KAAK,cAAcC,gEAA2B,QACzD,WACA,GACD;EACD,oBACE,OAAO,iBAAiB,IAAI,MAAM,YAClCC;EACF;EAGA,yBAAyB;EACzB,eAAe,KAAK;EACpB,YAAY,GAAGC,qDAAgB,GAAG,KAAK;EACvC,GAAI,4BAA4B,SAC5B,EAAE,GACF,EAAE,0BAA0B;EAChC,GAAI,kCAAkC,SAClC,EAAE,GACF,EAAE,gCAAgC;EACtC,GAAI,KAAK,MAAM,iBAAiB,SAC5B,EAAE,GACF,EAAE,mBAAmB,KAAK,KAAK,eAAe;EAClD,GAAI,KAAK,MAAM,kBAAkB,SAC7B,EAAE,GACF,EAAE,kBAAkB,KAAK,KAAK,gBAAgB;EACnD,EACD;EAGE,0BACEC,8CAAmB,OAAO,CAAC,MAAM,EAAE,gBAAgB,UAAU;EAK/D,sBAAsB;AACpB,GAAKC,gEACH,EAAE,QAAQ,gCAAgC,EAC1C,OACD,CAAC,OAAO,UAAU;AACjB,SAAK,OAAO,MACV,sDACA,MACD;KACD;;EAEL,CACF;;;;;;ACrEH,MAAa,6BAA6B,UAAyB;AACjE,QAAOC,qDAAgB,OAAO,yBAAyB;;;;;;ACMzD,MAAa,0CACX,EAAE,iBACF,WACuB;CACvB,MAAM,iBAAiBC,wEACrB,EAAE,eAAe,EACjB,OACD;AAED,KAAI,CAACC,0DAAqB,eAAe,CACvC,OAAM,IAAIC,uDAA0B,EAClC,eAAe,cAAc,SAC9B,CAAC;AAGJ,QAAO;;;;;;;;;;;;;;;;;;;;;;;ACgCT,MAAa,wBAAwB,OACnC,EACE,WACA,UACA,mBACA,KACA,UACA,WAEF,SAASC,uDAAkB,KACgB;CAC3C,MAAM,YAAYC,wDAAmB,OAAO;AAE5C,KAAI,UAAU,WAAW,EACvB,OAAM,IAAIC,gEAA2B,EACnC,mBAAmBC,2DAAsB,aAC1C,CAAC;CAKJ,MAAM,eAAe,UAAU,KAAKC,0DAAqB;AAEzD,KAAI,CAAC,aACH,OAAM,IAAI,2BAA2B,EACnC,mBAAmB,UAAU,GAAG,KACjC,CAAC;CAGJ,MAAM,SAAS,MAAM,aAAa,sBAAsB;EACtD;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,OAAMC,mDAAY,OAAO;AAEzB,QAAO"}
|
|
1
|
+
{"version":3,"file":"migrateFromFireblocks-BnHU2AZJ.cjs","names":["BaseError","createWaasClient: CreateWaasClient","getCore","DynamicWalletClient","isCookieEnabled","DEFAULT_WAAS_BASE_API_URL","DEFAULT_WAAS_BASE_MPC_RELAY_API_URL","CLIENT_SDK_NAME","getSignedSessionId","logoutWithReason","CHAINS_INFO_MAP","getWalletProviderFromWalletAccount","isWaasWalletProvider","NotWaasWalletAccountError","getDefaultClient","getWalletProviders","NoWalletProviderFoundError","DYNAMIC_WAAS_METADATA","isWaasWalletProvider","refreshAuth"],"sources":["../src/errors/NotWaasWalletProviderError.ts","../src/modules/waas/createWaasClient/createWaasClient.ts","../src/modules/waas/getWaasChainNameFromChain/getWaasChainNameFromChain.ts","../src/modules/waas/getWaasWalletProviderFromWalletAccount/getWaasWalletProviderFromWalletAccount.ts","../src/modules/waas/migrateFromFireblocks/migrateFromFireblocks.ts"],"sourcesContent":["import { BaseError } from './base';\n\ntype NotWaasWalletProviderErrorParams = {\n walletProviderKey: string;\n};\n\nexport class NotWaasWalletProviderError extends BaseError {\n constructor({ walletProviderKey }: NotWaasWalletProviderErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_provider_error',\n docsUrl: null,\n name: 'NotWaasWalletProviderError',\n shortMessage: `Wallet provider ${walletProviderKey} is not a Dynamic WaaS wallet provider`,\n });\n }\n}\n","import type { AuthMode } from '@dynamic-labs-wallet/browser-wallet-client';\nimport { DynamicWalletClient } from '@dynamic-labs-wallet/browser-wallet-client';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { CLIENT_SDK_NAME } from '../../apiClient/constants';\nimport { logoutWithReason } from '../../auth/logoutWithReason';\nimport { isCookieEnabled } from '../../projectSettings/isCookieEnabled';\nimport { getSignedSessionId } from '../../sessionKeys/getSignedSessionId';\nimport type { CreateWaasClient } from './createWaasClient.types';\nimport {\n DEFAULT_WAAS_BASE_API_URL,\n DEFAULT_WAAS_BASE_MPC_RELAY_API_URL,\n} from '../constants';\n\n/** @notInstrumented */\nexport const createWaasClient: CreateWaasClient = ({ chainName }, client) => {\n const core = getCore(client);\n\n const additionalTrustedOrigins = core.waas?.additionalTrustedOrigins;\n\n const baseClientKeysharesRelayApiUrl =\n client.projectSettings?.sdk.waas?.customKeyshareRelayBaseUrl;\n\n return new DynamicWalletClient(\n {\n authMode: (isCookieEnabled(client) ? 'cookie' : 'header') as AuthMode,\n authToken: client.token || '',\n baseApiUrl: (core.apiBaseUrl || DEFAULT_WAAS_BASE_API_URL).replace(\n '/api/v0',\n ''\n ),\n baseMPCRelayApiUrl:\n client.projectSettings?.sdk.waas?.relayUrl ||\n DEFAULT_WAAS_BASE_MPC_RELAY_API_URL,\n chainName,\n // Opt into the SDK self-driving eager key-share recovery on auth-token\n // arrival, so the client no longer restores shares itself on login.\n eagerlyRecoverKeyShares: true,\n environmentId: core.environmentId,\n sdkVersion: `${CLIENT_SDK_NAME}/${core.version}`,\n ...(additionalTrustedOrigins == undefined\n ? {}\n : { additionalTrustedOrigins }),\n ...(baseClientKeysharesRelayApiUrl == undefined\n ? {}\n : { baseClientKeysharesRelayApiUrl }),\n ...(core.waas?.loadTimeoutMs == undefined\n ? {}\n : { iframeLoadTimeout: core.waas.loadTimeoutMs }),\n ...(core.waas?.maxLoadRetries == undefined\n ? {}\n : { maxRetryAttempts: core.waas.maxLoadRetries }),\n },\n {\n // Lets the iframe mint a fresh signed session id over the reverse channel,\n // which the SDK's eager key-share recovery needs.\n getSignedSessionId: () =>\n getSignedSessionId(client).then(({ signature }) => signature),\n // When the WaaS iframe's own backend call returns 401 (e.g. a forcibly\n // revoked token), the iframe notifies the host via the reverse channel\n // and this fires — log the user out. Mirrors the session-expiry\n // middleware that covers the SDK's own direct API 401s.\n onUnauthorized: () => {\n void logoutWithReason(\n { reason: 'session-refresh-unauthorized' },\n client\n ).catch((error) => {\n core.logger.error(\n 'Failed to log out after WaaS unauthorized response',\n error\n );\n });\n },\n }\n );\n};\n","import type { Chain } from '../../chain';\nimport { CHAINS_INFO_MAP } from '../../wallets/constants';\n\n/** @notInstrumented */\n// eslint-disable-next-line custom-rules/require-single-object-param\nexport const getWaasChainNameFromChain = (chain: Chain): string => {\n return CHAINS_INFO_MAP[chain].waasChainNameOverride || chain;\n};\n","import type { DynamicClient } from '../../../client/types/DynamicClient';\nimport { NotWaasWalletAccountError } from '../../../errors/NotWaasWalletAccountError';\nimport { getWalletProviderFromWalletAccount } from '../../wallets/utils/getWalletProviderFromWalletAccount';\nimport type { WalletAccount } from '../../wallets/walletAccount';\nimport { isWaasWalletProvider } from '../isWaasWalletProvider';\nimport type { WaasWalletProvider } from '../waas.types';\n\ntype GetWalletProviderFromWalletAccountParams = {\n walletAccount: WalletAccount;\n};\n\n/** @notInstrumented */\nexport const getWaasWalletProviderFromWalletAccount = (\n { walletAccount }: GetWalletProviderFromWalletAccountParams,\n client: DynamicClient\n): WaasWalletProvider => {\n const walletProvider = getWalletProviderFromWalletAccount(\n { walletAccount },\n client\n );\n\n if (!isWaasWalletProvider(walletProvider)) {\n throw new NotWaasWalletAccountError({\n walletAddress: walletAccount.address,\n });\n }\n\n return walletProvider;\n};\n","import type { MigrateFromFireblocksResponse } from '@dynamic-labs-wallet/browser-wallet-client';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { NoWalletProviderFoundError } from '../../../errors/NoWalletProviderFoundError';\nimport { NotWaasWalletProviderError } from '../../../errors/NotWaasWalletProviderError';\nimport { refreshAuth } from '../../user/refreshAuth';\nimport { getWalletProviders } from '../../wallets/getWalletProviders';\nimport { DYNAMIC_WAAS_METADATA } from '../constants';\nimport { isWaasWalletProvider } from '../isWaasWalletProvider';\n\ntype MigrateFromFireblocksParams = {\n /**\n * Optional SLIP-0044 coin types per chain name for BIP44 derivation off the\n * Fireblocks takeover xprv (e.g. `{ EVM: 1 }` for Sepolia).\n */\n coinTypes?: Record<string, number>;\n /**\n * The Fireblocks NCW device id whose key material is being migrated.\n */\n deviceId: string;\n /**\n * Required per-chain expected wallet address (the address Fireblocks held). Its\n * keys are the chains migration runs on, and the migration iframe verifies each\n * imported Dynamic address matches the value, so a wrong derivation fails loudly\n * instead of producing an unusable wallet.\n */\n expectedAddresses: Record<string, string>;\n /**\n * The Fireblocks-issued JWT authorizing the takeover.\n */\n jwt: string;\n /**\n * The password that encrypted the legacy Fireblocks NCW device storage.\n */\n password: string;\n /**\n * The serialized Fireblocks NCW device storage (the local key share backup).\n */\n storage: Record<string, string>;\n};\n\n/**\n * Migrates an existing Fireblocks NCW wallet into Dynamic's WaaS infrastructure.\n *\n * Migration is a single cross-chain operation: one call takes over the Fireblocks\n * key material and provisions Dynamic WaaS wallet accounts for every supported\n * chain. Because it is not per-chain, this resolves a single WaaS wallet provider\n * (any registered chain) and delegates the takeover to it.\n *\n * @param params.deviceId - The Fireblocks NCW device id being migrated.\n * @param params.jwt - The Fireblocks-issued JWT authorizing the takeover.\n * @param params.storage - The serialized Fireblocks NCW device storage.\n * @param params.password - The password that encrypted the legacy device storage.\n * @param params.expectedAddresses - Required per-chain expected address; its keys are the chains migration runs on, and each imported address is verified against it.\n * @param [params.coinTypes] - Optional SLIP-0044 coin types per chain name.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise resolving to the per-chain migration results.\n * @notInstrumented\n */\nexport const migrateFromFireblocks = async (\n {\n coinTypes,\n deviceId,\n expectedAddresses,\n jwt,\n password,\n storage,\n }: MigrateFromFireblocksParams,\n client = getDefaultClient()\n): Promise<MigrateFromFireblocksResponse> => {\n const providers = getWalletProviders(client);\n\n if (providers.length === 0) {\n throw new NoWalletProviderFoundError({\n walletProviderKey: DYNAMIC_WAAS_METADATA.displayName,\n });\n }\n\n // Migration is cross-chain, so any registered WaaS provider can drive the\n // takeover. Resolve the first one rather than iterating per chain.\n const waasProvider = providers.find(isWaasWalletProvider);\n\n if (!waasProvider) {\n throw new NotWaasWalletProviderError({\n walletProviderKey: providers[0].key,\n });\n }\n\n const result = await waasProvider.migrateFromFireblocks({\n coinTypes,\n deviceId,\n expectedAddresses,\n jwt,\n password,\n storage,\n });\n\n await refreshAuth(client);\n\n return result;\n};\n"],"mappings":";;;;;;AAMA,IAAa,6BAAb,cAAgDA,+CAAU;CACxD,YAAY,EAAE,qBAAuD;AACnE,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,mBAAmB,kBAAkB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wB,OACnC,EACE,WACA,UACA,mBACA,KACA,UACA,WAEF,SAASC,uDAAkB,KACgB;CAC3C,MAAM,YAAYC,wDAAmB,OAAO;AAE5C,KAAI,UAAU,WAAW,EACvB,OAAM,IAAIC,gEAA2B,EACnC,mBAAmBC,2DAAsB,aAC1C,CAAC;CAKJ,MAAM,eAAe,UAAU,KAAKC,0DAAqB;AAEzD,KAAI,CAAC,aACH,OAAM,IAAI,2BAA2B,EACnC,mBAAmB,UAAU,GAAG,KACjC,CAAC;CAGJ,MAAM,SAAS,MAAM,aAAa,sBAAsB;EACtD;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,OAAMC,mDAAY,OAAO;AAEzB,QAAO"}
|
package/dist/{migrateFromFireblocks-Btox03CB.esm.js → migrateFromFireblocks-DkQj3aYU.esm.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as NotWaasWalletAccountError, r as __refreshAuth_wrapped } from "./isDynamicWaasEnabled-
|
|
3
|
-
import { t as getSignedSessionId } from "./getSignedSessionId-
|
|
1
|
+
import { C as getWalletProviderFromWalletAccount, D as NoWalletProviderFoundError, F as CHAINS_INFO_MAP, _t as getDefaultClient, bt as BaseError, c as isWaasWalletProvider, d as DYNAMIC_WAAS_METADATA, f as getWalletProviders, g as __logoutWithReason_wrapped, l as DEFAULT_WAAS_BASE_API_URL, ot as CLIENT_SDK_NAME, u as DEFAULT_WAAS_BASE_MPC_RELAY_API_URL, ut as isCookieEnabled, xt as getCore } from "./updateAuthFromVerifyResponse-wHGRunTk.esm.js";
|
|
2
|
+
import { n as NotWaasWalletAccountError, r as __refreshAuth_wrapped } from "./isDynamicWaasEnabled-OlDJAGIi.esm.js";
|
|
3
|
+
import { t as getSignedSessionId } from "./getSignedSessionId-CDEQ6TMC.esm.js";
|
|
4
4
|
import { DynamicWalletClient } from "@dynamic-labs-wallet/browser-wallet-client";
|
|
5
5
|
|
|
6
6
|
//#region src/errors/NotWaasWalletProviderError.ts
|
|
@@ -101,4 +101,4 @@ const migrateFromFireblocks = async ({ coinTypes, deviceId, expectedAddresses, j
|
|
|
101
101
|
|
|
102
102
|
//#endregion
|
|
103
103
|
export { NotWaasWalletProviderError as a, createWaasClient as i, getWaasWalletProviderFromWalletAccount as n, getWaasChainNameFromChain as r, migrateFromFireblocks as t };
|
|
104
|
-
//# sourceMappingURL=migrateFromFireblocks-
|
|
104
|
+
//# sourceMappingURL=migrateFromFireblocks-DkQj3aYU.esm.js.map
|
package/dist/{migrateFromFireblocks-Btox03CB.esm.js.map → migrateFromFireblocks-DkQj3aYU.esm.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrateFromFireblocks-Btox03CB.esm.js","names":["createWaasClient: CreateWaasClient","logoutWithReason","refreshAuth"],"sources":["../src/errors/NotWaasWalletProviderError.ts","../src/modules/waas/createWaasClient/createWaasClient.ts","../src/modules/waas/getWaasChainNameFromChain/getWaasChainNameFromChain.ts","../src/modules/waas/getWaasWalletProviderFromWalletAccount/getWaasWalletProviderFromWalletAccount.ts","../src/modules/waas/migrateFromFireblocks/migrateFromFireblocks.ts"],"sourcesContent":["import { BaseError } from './base';\n\ntype NotWaasWalletProviderErrorParams = {\n walletProviderKey: string;\n};\n\nexport class NotWaasWalletProviderError extends BaseError {\n constructor({ walletProviderKey }: NotWaasWalletProviderErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_provider_error',\n docsUrl: null,\n name: 'NotWaasWalletProviderError',\n shortMessage: `Wallet provider ${walletProviderKey} is not a Dynamic WaaS wallet provider`,\n });\n }\n}\n","import type { AuthMode } from '@dynamic-labs-wallet/browser-wallet-client';\nimport { DynamicWalletClient } from '@dynamic-labs-wallet/browser-wallet-client';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { CLIENT_SDK_NAME } from '../../apiClient/constants';\nimport { logoutWithReason } from '../../auth/logoutWithReason';\nimport { isCookieEnabled } from '../../projectSettings/isCookieEnabled';\nimport { getSignedSessionId } from '../../sessionKeys/getSignedSessionId';\nimport type { CreateWaasClient } from './createWaasClient.types';\nimport {\n DEFAULT_WAAS_BASE_API_URL,\n DEFAULT_WAAS_BASE_MPC_RELAY_API_URL,\n} from '../constants';\n\n/** @notInstrumented */\nexport const createWaasClient: CreateWaasClient = ({ chainName }, client) => {\n const core = getCore(client);\n\n const additionalTrustedOrigins = core.waas?.additionalTrustedOrigins;\n\n const baseClientKeysharesRelayApiUrl =\n client.projectSettings?.sdk.waas?.customKeyshareRelayBaseUrl;\n\n return new DynamicWalletClient(\n {\n authMode: (isCookieEnabled(client) ? 'cookie' : 'header') as AuthMode,\n authToken: client.token || '',\n baseApiUrl: (core.apiBaseUrl || DEFAULT_WAAS_BASE_API_URL).replace(\n '/api/v0',\n ''\n ),\n baseMPCRelayApiUrl:\n client.projectSettings?.sdk.waas?.relayUrl ||\n DEFAULT_WAAS_BASE_MPC_RELAY_API_URL,\n chainName,\n // Opt into the SDK self-driving eager key-share recovery on auth-token\n // arrival, so the client no longer restores shares itself on login.\n eagerlyRecoverKeyShares: true,\n environmentId: core.environmentId,\n sdkVersion: `${CLIENT_SDK_NAME}/${core.version}`,\n ...(additionalTrustedOrigins == undefined\n ? {}\n : { additionalTrustedOrigins }),\n ...(baseClientKeysharesRelayApiUrl == undefined\n ? {}\n : { baseClientKeysharesRelayApiUrl }),\n ...(core.waas?.loadTimeoutMs == undefined\n ? {}\n : { iframeLoadTimeout: core.waas.loadTimeoutMs }),\n ...(core.waas?.maxLoadRetries == undefined\n ? {}\n : { maxRetryAttempts: core.waas.maxLoadRetries }),\n },\n {\n // Lets the iframe mint a fresh signed session id over the reverse channel,\n // which the SDK's eager key-share recovery needs.\n getSignedSessionId: () =>\n getSignedSessionId(client).then(({ signature }) => signature),\n // When the WaaS iframe's own backend call returns 401 (e.g. a forcibly\n // revoked token), the iframe notifies the host via the reverse channel\n // and this fires — log the user out. Mirrors the session-expiry\n // middleware that covers the SDK's own direct API 401s.\n onUnauthorized: () => {\n void logoutWithReason(\n { reason: 'session-refresh-unauthorized' },\n client\n ).catch((error) => {\n core.logger.error(\n 'Failed to log out after WaaS unauthorized response',\n error\n );\n });\n },\n }\n );\n};\n","import type { Chain } from '../../chain';\nimport { CHAINS_INFO_MAP } from '../../wallets/constants';\n\n/** @notInstrumented */\n// eslint-disable-next-line custom-rules/require-single-object-param\nexport const getWaasChainNameFromChain = (chain: Chain): string => {\n return CHAINS_INFO_MAP[chain].waasChainNameOverride || chain;\n};\n","import type { DynamicClient } from '../../../client/types/DynamicClient';\nimport { NotWaasWalletAccountError } from '../../../errors/NotWaasWalletAccountError';\nimport { getWalletProviderFromWalletAccount } from '../../wallets/utils/getWalletProviderFromWalletAccount';\nimport type { WalletAccount } from '../../wallets/walletAccount';\nimport { isWaasWalletProvider } from '../isWaasWalletProvider';\nimport type { WaasWalletProvider } from '../waas.types';\n\ntype GetWalletProviderFromWalletAccountParams = {\n walletAccount: WalletAccount;\n};\n\n/** @notInstrumented */\nexport const getWaasWalletProviderFromWalletAccount = (\n { walletAccount }: GetWalletProviderFromWalletAccountParams,\n client: DynamicClient\n): WaasWalletProvider => {\n const walletProvider = getWalletProviderFromWalletAccount(\n { walletAccount },\n client\n );\n\n if (!isWaasWalletProvider(walletProvider)) {\n throw new NotWaasWalletAccountError({\n walletAddress: walletAccount.address,\n });\n }\n\n return walletProvider;\n};\n","import type { MigrateFromFireblocksResponse } from '@dynamic-labs-wallet/browser-wallet-client';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { NoWalletProviderFoundError } from '../../../errors/NoWalletProviderFoundError';\nimport { NotWaasWalletProviderError } from '../../../errors/NotWaasWalletProviderError';\nimport { refreshAuth } from '../../user/refreshAuth';\nimport { getWalletProviders } from '../../wallets/getWalletProviders';\nimport { DYNAMIC_WAAS_METADATA } from '../constants';\nimport { isWaasWalletProvider } from '../isWaasWalletProvider';\n\ntype MigrateFromFireblocksParams = {\n /**\n * Optional SLIP-0044 coin types per chain name for BIP44 derivation off the\n * Fireblocks takeover xprv (e.g. `{ EVM: 1 }` for Sepolia).\n */\n coinTypes?: Record<string, number>;\n /**\n * The Fireblocks NCW device id whose key material is being migrated.\n */\n deviceId: string;\n /**\n * Required per-chain expected wallet address (the address Fireblocks held). Its\n * keys are the chains migration runs on, and the migration iframe verifies each\n * imported Dynamic address matches the value, so a wrong derivation fails loudly\n * instead of producing an unusable wallet.\n */\n expectedAddresses: Record<string, string>;\n /**\n * The Fireblocks-issued JWT authorizing the takeover.\n */\n jwt: string;\n /**\n * The password that encrypted the legacy Fireblocks NCW device storage.\n */\n password: string;\n /**\n * The serialized Fireblocks NCW device storage (the local key share backup).\n */\n storage: Record<string, string>;\n};\n\n/**\n * Migrates an existing Fireblocks NCW wallet into Dynamic's WaaS infrastructure.\n *\n * Migration is a single cross-chain operation: one call takes over the Fireblocks\n * key material and provisions Dynamic WaaS wallet accounts for every supported\n * chain. Because it is not per-chain, this resolves a single WaaS wallet provider\n * (any registered chain) and delegates the takeover to it.\n *\n * @param params.deviceId - The Fireblocks NCW device id being migrated.\n * @param params.jwt - The Fireblocks-issued JWT authorizing the takeover.\n * @param params.storage - The serialized Fireblocks NCW device storage.\n * @param params.password - The password that encrypted the legacy device storage.\n * @param params.expectedAddresses - Required per-chain expected address; its keys are the chains migration runs on, and each imported address is verified against it.\n * @param [params.coinTypes] - Optional SLIP-0044 coin types per chain name.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise resolving to the per-chain migration results.\n * @notInstrumented\n */\nexport const migrateFromFireblocks = async (\n {\n coinTypes,\n deviceId,\n expectedAddresses,\n jwt,\n password,\n storage,\n }: MigrateFromFireblocksParams,\n client = getDefaultClient()\n): Promise<MigrateFromFireblocksResponse> => {\n const providers = getWalletProviders(client);\n\n if (providers.length === 0) {\n throw new NoWalletProviderFoundError({\n walletProviderKey: DYNAMIC_WAAS_METADATA.displayName,\n });\n }\n\n // Migration is cross-chain, so any registered WaaS provider can drive the\n // takeover. Resolve the first one rather than iterating per chain.\n const waasProvider = providers.find(isWaasWalletProvider);\n\n if (!waasProvider) {\n throw new NotWaasWalletProviderError({\n walletProviderKey: providers[0].key,\n });\n }\n\n const result = await waasProvider.migrateFromFireblocks({\n coinTypes,\n deviceId,\n expectedAddresses,\n jwt,\n password,\n storage,\n });\n\n await refreshAuth(client);\n\n return result;\n};\n"],"mappings":";;;;;;AAMA,IAAa,6BAAb,cAAgD,UAAU;CACxD,YAAY,EAAE,qBAAuD;AACnE,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,mBAAmB,kBAAkB;GACpD,CAAC;;;;;;;ACCN,MAAaA,oBAAsC,EAAE,aAAa,WAAW;CAC3E,MAAM,OAAO,QAAQ,OAAO;CAE5B,MAAM,2BAA2B,KAAK,MAAM;CAE5C,MAAM,iCACJ,OAAO,iBAAiB,IAAI,MAAM;AAEpC,QAAO,IAAI,oBACT;EACE,UAAW,gBAAgB,OAAO,GAAG,WAAW;EAChD,WAAW,OAAO,SAAS;EAC3B,aAAa,KAAK,cAAc,2BAA2B,QACzD,WACA,GACD;EACD,oBACE,OAAO,iBAAiB,IAAI,MAAM,YAClC;EACF;EAGA,yBAAyB;EACzB,eAAe,KAAK;EACpB,YAAY,GAAG,gBAAgB,GAAG,KAAK;EACvC,GAAI,4BAA4B,SAC5B,EAAE,GACF,EAAE,0BAA0B;EAChC,GAAI,kCAAkC,SAClC,EAAE,GACF,EAAE,gCAAgC;EACtC,GAAI,KAAK,MAAM,iBAAiB,SAC5B,EAAE,GACF,EAAE,mBAAmB,KAAK,KAAK,eAAe;EAClD,GAAI,KAAK,MAAM,kBAAkB,SAC7B,EAAE,GACF,EAAE,kBAAkB,KAAK,KAAK,gBAAgB;EACnD,EACD;EAGE,0BACE,mBAAmB,OAAO,CAAC,MAAM,EAAE,gBAAgB,UAAU;EAK/D,sBAAsB;AACpB,GAAKC,2BACH,EAAE,QAAQ,gCAAgC,EAC1C,OACD,CAAC,OAAO,UAAU;AACjB,SAAK,OAAO,MACV,sDACA,MACD;KACD;;EAEL,CACF;;;;;;ACrEH,MAAa,6BAA6B,UAAyB;AACjE,QAAO,gBAAgB,OAAO,yBAAyB;;;;;;ACMzD,MAAa,0CACX,EAAE,iBACF,WACuB;CACvB,MAAM,iBAAiB,mCACrB,EAAE,eAAe,EACjB,OACD;AAED,KAAI,CAAC,qBAAqB,eAAe,CACvC,OAAM,IAAI,0BAA0B,EAClC,eAAe,cAAc,SAC9B,CAAC;AAGJ,QAAO;;;;;;;;;;;;;;;;;;;;;;;ACgCT,MAAa,wBAAwB,OACnC,EACE,WACA,UACA,mBACA,KACA,UACA,WAEF,SAAS,kBAAkB,KACgB;CAC3C,MAAM,YAAY,mBAAmB,OAAO;AAE5C,KAAI,UAAU,WAAW,EACvB,OAAM,IAAI,2BAA2B,EACnC,mBAAmB,sBAAsB,aAC1C,CAAC;CAKJ,MAAM,eAAe,UAAU,KAAK,qBAAqB;AAEzD,KAAI,CAAC,aACH,OAAM,IAAI,2BAA2B,EACnC,mBAAmB,UAAU,GAAG,KACjC,CAAC;CAGJ,MAAM,SAAS,MAAM,aAAa,sBAAsB;EACtD;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,OAAMC,sBAAY,OAAO;AAEzB,QAAO"}
|
|
1
|
+
{"version":3,"file":"migrateFromFireblocks-DkQj3aYU.esm.js","names":["createWaasClient: CreateWaasClient","logoutWithReason","refreshAuth"],"sources":["../src/errors/NotWaasWalletProviderError.ts","../src/modules/waas/createWaasClient/createWaasClient.ts","../src/modules/waas/getWaasChainNameFromChain/getWaasChainNameFromChain.ts","../src/modules/waas/getWaasWalletProviderFromWalletAccount/getWaasWalletProviderFromWalletAccount.ts","../src/modules/waas/migrateFromFireblocks/migrateFromFireblocks.ts"],"sourcesContent":["import { BaseError } from './base';\n\ntype NotWaasWalletProviderErrorParams = {\n walletProviderKey: string;\n};\n\nexport class NotWaasWalletProviderError extends BaseError {\n constructor({ walletProviderKey }: NotWaasWalletProviderErrorParams) {\n super({\n cause: null,\n code: 'not_waas_wallet_provider_error',\n docsUrl: null,\n name: 'NotWaasWalletProviderError',\n shortMessage: `Wallet provider ${walletProviderKey} is not a Dynamic WaaS wallet provider`,\n });\n }\n}\n","import type { AuthMode } from '@dynamic-labs-wallet/browser-wallet-client';\nimport { DynamicWalletClient } from '@dynamic-labs-wallet/browser-wallet-client';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { CLIENT_SDK_NAME } from '../../apiClient/constants';\nimport { logoutWithReason } from '../../auth/logoutWithReason';\nimport { isCookieEnabled } from '../../projectSettings/isCookieEnabled';\nimport { getSignedSessionId } from '../../sessionKeys/getSignedSessionId';\nimport type { CreateWaasClient } from './createWaasClient.types';\nimport {\n DEFAULT_WAAS_BASE_API_URL,\n DEFAULT_WAAS_BASE_MPC_RELAY_API_URL,\n} from '../constants';\n\n/** @notInstrumented */\nexport const createWaasClient: CreateWaasClient = ({ chainName }, client) => {\n const core = getCore(client);\n\n const additionalTrustedOrigins = core.waas?.additionalTrustedOrigins;\n\n const baseClientKeysharesRelayApiUrl =\n client.projectSettings?.sdk.waas?.customKeyshareRelayBaseUrl;\n\n return new DynamicWalletClient(\n {\n authMode: (isCookieEnabled(client) ? 'cookie' : 'header') as AuthMode,\n authToken: client.token || '',\n baseApiUrl: (core.apiBaseUrl || DEFAULT_WAAS_BASE_API_URL).replace(\n '/api/v0',\n ''\n ),\n baseMPCRelayApiUrl:\n client.projectSettings?.sdk.waas?.relayUrl ||\n DEFAULT_WAAS_BASE_MPC_RELAY_API_URL,\n chainName,\n // Opt into the SDK self-driving eager key-share recovery on auth-token\n // arrival, so the client no longer restores shares itself on login.\n eagerlyRecoverKeyShares: true,\n environmentId: core.environmentId,\n sdkVersion: `${CLIENT_SDK_NAME}/${core.version}`,\n ...(additionalTrustedOrigins == undefined\n ? {}\n : { additionalTrustedOrigins }),\n ...(baseClientKeysharesRelayApiUrl == undefined\n ? {}\n : { baseClientKeysharesRelayApiUrl }),\n ...(core.waas?.loadTimeoutMs == undefined\n ? {}\n : { iframeLoadTimeout: core.waas.loadTimeoutMs }),\n ...(core.waas?.maxLoadRetries == undefined\n ? {}\n : { maxRetryAttempts: core.waas.maxLoadRetries }),\n },\n {\n // Lets the iframe mint a fresh signed session id over the reverse channel,\n // which the SDK's eager key-share recovery needs.\n getSignedSessionId: () =>\n getSignedSessionId(client).then(({ signature }) => signature),\n // When the WaaS iframe's own backend call returns 401 (e.g. a forcibly\n // revoked token), the iframe notifies the host via the reverse channel\n // and this fires — log the user out. Mirrors the session-expiry\n // middleware that covers the SDK's own direct API 401s.\n onUnauthorized: () => {\n void logoutWithReason(\n { reason: 'session-refresh-unauthorized' },\n client\n ).catch((error) => {\n core.logger.error(\n 'Failed to log out after WaaS unauthorized response',\n error\n );\n });\n },\n }\n );\n};\n","import type { Chain } from '../../chain';\nimport { CHAINS_INFO_MAP } from '../../wallets/constants';\n\n/** @notInstrumented */\n// eslint-disable-next-line custom-rules/require-single-object-param\nexport const getWaasChainNameFromChain = (chain: Chain): string => {\n return CHAINS_INFO_MAP[chain].waasChainNameOverride || chain;\n};\n","import type { DynamicClient } from '../../../client/types/DynamicClient';\nimport { NotWaasWalletAccountError } from '../../../errors/NotWaasWalletAccountError';\nimport { getWalletProviderFromWalletAccount } from '../../wallets/utils/getWalletProviderFromWalletAccount';\nimport type { WalletAccount } from '../../wallets/walletAccount';\nimport { isWaasWalletProvider } from '../isWaasWalletProvider';\nimport type { WaasWalletProvider } from '../waas.types';\n\ntype GetWalletProviderFromWalletAccountParams = {\n walletAccount: WalletAccount;\n};\n\n/** @notInstrumented */\nexport const getWaasWalletProviderFromWalletAccount = (\n { walletAccount }: GetWalletProviderFromWalletAccountParams,\n client: DynamicClient\n): WaasWalletProvider => {\n const walletProvider = getWalletProviderFromWalletAccount(\n { walletAccount },\n client\n );\n\n if (!isWaasWalletProvider(walletProvider)) {\n throw new NotWaasWalletAccountError({\n walletAddress: walletAccount.address,\n });\n }\n\n return walletProvider;\n};\n","import type { MigrateFromFireblocksResponse } from '@dynamic-labs-wallet/browser-wallet-client';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { NoWalletProviderFoundError } from '../../../errors/NoWalletProviderFoundError';\nimport { NotWaasWalletProviderError } from '../../../errors/NotWaasWalletProviderError';\nimport { refreshAuth } from '../../user/refreshAuth';\nimport { getWalletProviders } from '../../wallets/getWalletProviders';\nimport { DYNAMIC_WAAS_METADATA } from '../constants';\nimport { isWaasWalletProvider } from '../isWaasWalletProvider';\n\ntype MigrateFromFireblocksParams = {\n /**\n * Optional SLIP-0044 coin types per chain name for BIP44 derivation off the\n * Fireblocks takeover xprv (e.g. `{ EVM: 1 }` for Sepolia).\n */\n coinTypes?: Record<string, number>;\n /**\n * The Fireblocks NCW device id whose key material is being migrated.\n */\n deviceId: string;\n /**\n * Required per-chain expected wallet address (the address Fireblocks held). Its\n * keys are the chains migration runs on, and the migration iframe verifies each\n * imported Dynamic address matches the value, so a wrong derivation fails loudly\n * instead of producing an unusable wallet.\n */\n expectedAddresses: Record<string, string>;\n /**\n * The Fireblocks-issued JWT authorizing the takeover.\n */\n jwt: string;\n /**\n * The password that encrypted the legacy Fireblocks NCW device storage.\n */\n password: string;\n /**\n * The serialized Fireblocks NCW device storage (the local key share backup).\n */\n storage: Record<string, string>;\n};\n\n/**\n * Migrates an existing Fireblocks NCW wallet into Dynamic's WaaS infrastructure.\n *\n * Migration is a single cross-chain operation: one call takes over the Fireblocks\n * key material and provisions Dynamic WaaS wallet accounts for every supported\n * chain. Because it is not per-chain, this resolves a single WaaS wallet provider\n * (any registered chain) and delegates the takeover to it.\n *\n * @param params.deviceId - The Fireblocks NCW device id being migrated.\n * @param params.jwt - The Fireblocks-issued JWT authorizing the takeover.\n * @param params.storage - The serialized Fireblocks NCW device storage.\n * @param params.password - The password that encrypted the legacy device storage.\n * @param params.expectedAddresses - Required per-chain expected address; its keys are the chains migration runs on, and each imported address is verified against it.\n * @param [params.coinTypes] - Optional SLIP-0044 coin types per chain name.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise resolving to the per-chain migration results.\n * @notInstrumented\n */\nexport const migrateFromFireblocks = async (\n {\n coinTypes,\n deviceId,\n expectedAddresses,\n jwt,\n password,\n storage,\n }: MigrateFromFireblocksParams,\n client = getDefaultClient()\n): Promise<MigrateFromFireblocksResponse> => {\n const providers = getWalletProviders(client);\n\n if (providers.length === 0) {\n throw new NoWalletProviderFoundError({\n walletProviderKey: DYNAMIC_WAAS_METADATA.displayName,\n });\n }\n\n // Migration is cross-chain, so any registered WaaS provider can drive the\n // takeover. Resolve the first one rather than iterating per chain.\n const waasProvider = providers.find(isWaasWalletProvider);\n\n if (!waasProvider) {\n throw new NotWaasWalletProviderError({\n walletProviderKey: providers[0].key,\n });\n }\n\n const result = await waasProvider.migrateFromFireblocks({\n coinTypes,\n deviceId,\n expectedAddresses,\n jwt,\n password,\n storage,\n });\n\n await refreshAuth(client);\n\n return result;\n};\n"],"mappings":";;;;;;AAMA,IAAa,6BAAb,cAAgD,UAAU;CACxD,YAAY,EAAE,qBAAuD;AACnE,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,mBAAmB,kBAAkB;GACpD,CAAC;;;;;;;ACCN,MAAaA,oBAAsC,EAAE,aAAa,WAAW;CAC3E,MAAM,OAAO,QAAQ,OAAO;CAE5B,MAAM,2BAA2B,KAAK,MAAM;CAE5C,MAAM,iCACJ,OAAO,iBAAiB,IAAI,MAAM;AAEpC,QAAO,IAAI,oBACT;EACE,UAAW,gBAAgB,OAAO,GAAG,WAAW;EAChD,WAAW,OAAO,SAAS;EAC3B,aAAa,KAAK,cAAc,2BAA2B,QACzD,WACA,GACD;EACD,oBACE,OAAO,iBAAiB,IAAI,MAAM,YAClC;EACF;EAGA,yBAAyB;EACzB,eAAe,KAAK;EACpB,YAAY,GAAG,gBAAgB,GAAG,KAAK;EACvC,GAAI,4BAA4B,S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YNAMIC_LOGOUT_REASON_HEADER = "x-dyn-logout-reason";
|
|
|
11
11
|
export declare const ELEVATED_ACCESS_TOKEN_HEADER = "x-dyn-elevated-access-token";
|
|
12
12
|
export declare const MFA_TOKEN_HEADER = "x-mfa-auth-token";
|
|
13
13
|
export declare const SESSION_PUBLIC_KEY_HEADER = "x-dyn-session-public-key";
|
|
14
|
-
export
|
|
14
|
+
export { SDK_API_CORE_VERSION as DYNAMIC_SDK_API_VERSION } from '../../constants';
|
|
15
15
|
export declare const DYNAMIC_SDK_SESSION_ID_HEADER = "x-dyn-session-id";
|
|
16
16
|
/**
|
|
17
17
|
* Reports the runtime platform (`web` or `react-native`) to the Dynamic API.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/modules/apiClient/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/modules/apiClient/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,sBAAsB,CAAC;AAE9D,eAAO,MAAM,yBAAyB,qBAAqB,CAAC;AAE5D,eAAO,MAAM,0BAA0B,kBAAkB,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,wBAAwB,CAAC;AAElE,eAAO,MAAM,4BAA4B,gCAAgC,CAAC;AAE1E,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAEnD,eAAO,MAAM,yBAAyB,6BAA6B,CAAC;AAEpE,OAAO,EAAE,oBAAoB,IAAI,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAElF,eAAO,MAAM,6BAA6B,qBAAqB,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,uBAAuB,CAAC;AAE5D,eAAO,MAAM,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { MFAAction, TokenScope } from '@dynamic-labs/sdk-api-core';
|
|
2
|
+
import type { DynamicClient } from '../../../client/types/DynamicClient';
|
|
3
|
+
type GetActionAuthorizationTokensParams = {
|
|
4
|
+
mfaAction: MFAAction;
|
|
5
|
+
scope: TokenScope;
|
|
6
|
+
};
|
|
7
|
+
type ActionAuthorizationTokens = {
|
|
8
|
+
elevatedAccessToken: string | undefined;
|
|
9
|
+
mfaToken: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Resolves the tokens that authorize a verification-gated wallet action.
|
|
13
|
+
*
|
|
14
|
+
* An elevated access token for `scope` is the current proof of verification, so
|
|
15
|
+
* it takes precedence: when one has been banked, the legacy per-action MFA token
|
|
16
|
+
* is left untouched. Demanding both would break every user who has a verified
|
|
17
|
+
* MFA method, because satisfying the challenge with `requestedScopes` mints an
|
|
18
|
+
* elevated access token and no MFA token -- leaving nothing for
|
|
19
|
+
* `consumeMfaTokenIfRequiredForAction` to consume, which then throws.
|
|
20
|
+
*
|
|
21
|
+
* @param params.mfaAction - The action whose legacy MFA requirement to evaluate.
|
|
22
|
+
* @param params.scope - The scope of the elevated access token that authorizes the action.
|
|
23
|
+
* @param client - The Dynamic client instance.
|
|
24
|
+
* @returns The elevated access token, or the legacy MFA token when no elevated token exists.
|
|
25
|
+
* @notInstrumented
|
|
26
|
+
*/
|
|
27
|
+
export declare const getActionAuthorizationTokens: ({ mfaAction, scope }: GetActionAuthorizationTokensParams, client: DynamicClient) => Promise<ActionAuthorizationTokens>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=getActionAuthorizationTokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getActionAuthorizationTokens.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/getActionAuthorizationTokens/getActionAuthorizationTokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAIzE,KAAK,kCAAkC,GAAG;IACxC,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,4BAA4B,yBACjB,kCAAkC,UAChD,aAAa,KACpB,OAAO,CAAC,yBAAyB,CAanC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/getActionAuthorizationTokens/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC"}
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* Surfaced in Datadog logout events so we can understand why users are being
|
|
5
5
|
* signed out.
|
|
6
6
|
*/
|
|
7
|
-
export type LogoutReason = 'user-intent' | 'token-expired' | 'keychain-migration-failed' | 'keychain-key-missing' | 'session-refresh-unauthorized' | 'user-refresh-failed' | 'user-deleted' | 'device-revoked' | 'all-devices-revoked';
|
|
7
|
+
export type LogoutReason = 'user-intent' | 'token-expired' | 'keychain-migration-failed' | 'keychain-key-missing' | 'session-refresh-unauthorized' | 'user-refresh-failed' | 'user-deleted' | 'device-revoked' | 'all-devices-revoked' | 'business-account-ownership-transferred';
|
|
8
8
|
//# sourceMappingURL=logoutReason.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logoutReason.d.ts","sourceRoot":"","sources":["../../../src/modules/auth/logoutReason.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GACpB,aAAa,GACb,eAAe,GACf,2BAA2B,GAC3B,sBAAsB,GACtB,8BAA8B,GAC9B,qBAAqB,GACrB,cAAc,GACd,gBAAgB,GAChB,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"logoutReason.d.ts","sourceRoot":"","sources":["../../../src/modules/auth/logoutReason.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GACpB,aAAa,GACb,eAAe,GACf,2BAA2B,GAC3B,sBAAsB,GACtB,8BAA8B,GAC9B,qBAAqB,GACrB,cAAc,GACd,gBAAgB,GAChB,qBAAqB,GACrB,wCAAwC,CAAC"}
|
package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DynamicClient } from '../../../../client/types';
|
|
1
2
|
import type { BusinessAccountMember, BusinessAccountMemberRole, BusinessAccountSignerIdentifierType } from '../businessAccounts.types';
|
|
2
3
|
type AddMemberParams = {
|
|
3
4
|
businessAccountId: string;
|
|
@@ -11,15 +12,19 @@ type AddMemberParams = {
|
|
|
11
12
|
* `userId`, or by `identifier` + `identifierType` (e.g. an email — the user is
|
|
12
13
|
* created if absent).
|
|
13
14
|
*
|
|
15
|
+
* Calls the SDK API directly (not the WaaS iframe): this is a server-state
|
|
16
|
+
* mutation with no MPC step, so a rejection (e.g. a 422 resource-limit) surfaces
|
|
17
|
+
* as a thrown error rather than stalling in the iframe bridge.
|
|
18
|
+
*
|
|
14
19
|
* @param params.businessAccountId - The ID of the business account.
|
|
15
20
|
* @param [params.userId] - The ID of the user to add as a member.
|
|
16
21
|
* @param [params.identifier] - The identifier value (e.g. an email address).
|
|
17
22
|
* @param [params.identifierType] - The identifier type (e.g. `email`).
|
|
18
|
-
* @param [params.role] - The member role (`admin` or `viewer`). Defaults
|
|
23
|
+
* @param [params.role] - The member role (`admin` or `viewer`). Defaults to `viewer`.
|
|
19
24
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
20
25
|
* @returns The created business account member.
|
|
21
26
|
* @notInstrumented
|
|
22
27
|
*/
|
|
23
|
-
export declare const addBusinessAccountMember: ({ businessAccountId, userId, identifier, identifierType, role, }: AddMemberParams, client?:
|
|
28
|
+
export declare const addBusinessAccountMember: ({ businessAccountId, userId, identifier, identifierType, role, }: AddMemberParams, client?: DynamicClient) => Promise<BusinessAccountMember>;
|
|
24
29
|
export {};
|
|
25
30
|
//# sourceMappingURL=addBusinessAccountMember.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addBusinessAccountMember.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"addBusinessAccountMember.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9D,OAAO,KAAK,EACV,qBAAqB,EACrB,yBAAyB,EACzB,mCAAmC,EACpC,MAAM,2BAA2B,CAAC;AAEnC,KAAK,eAAe,GAAG;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,mCAAmC,CAAC;IACrD,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,wBAAwB,qEAOhC,eAAe,WACV,aAAa,KACpB,OAAO,CAAC,qBAAqB,CAmB/B,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DynamicClient } from '../../../../client/types';
|
|
1
2
|
import type { BusinessAccountDetail } from '../businessAccounts.types';
|
|
2
3
|
type AddWalletParams = {
|
|
3
4
|
businessAccountId?: string;
|
|
@@ -8,12 +9,16 @@ type AddWalletParams = {
|
|
|
8
9
|
* find-or-create the per-wallet business account (the server seats the wallet's
|
|
9
10
|
* owner as the first member/signer).
|
|
10
11
|
*
|
|
12
|
+
* Calls the SDK API directly (not the WaaS iframe): this is a server-state
|
|
13
|
+
* mutation with no MPC step, so a rejection (e.g. a 422 resource-limit) surfaces
|
|
14
|
+
* as a thrown error rather than stalling in the iframe bridge.
|
|
15
|
+
*
|
|
11
16
|
* @param [params.businessAccountId] - The business account to link to; found-or-created when omitted.
|
|
12
17
|
* @param params.walletId - The ID of the wallet to link.
|
|
13
18
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
14
19
|
* @returns The updated business account detail.
|
|
15
20
|
* @notInstrumented
|
|
16
21
|
*/
|
|
17
|
-
export declare const addWalletToBusinessAccount: ({ businessAccountId, walletId }: AddWalletParams, client?:
|
|
22
|
+
export declare const addWalletToBusinessAccount: ({ businessAccountId, walletId }: AddWalletParams, client?: DynamicClient) => Promise<BusinessAccountDetail>;
|
|
18
23
|
export {};
|
|
19
24
|
//# sourceMappingURL=addWalletToBusinessAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addWalletToBusinessAccount.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"addWalletToBusinessAccount.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,KAAK,eAAe,GAAG;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,0BAA0B,oCACJ,eAAe,WACxC,aAAa,KACpB,OAAO,CAAC,qBAAqB,CAc/B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UserIdentifierTypeEnum } from '@dynamic-labs/sdk-api-core';
|
|
2
|
+
import type { BusinessAccountSignerIdentifierType } from './businessAccounts.types';
|
|
3
|
+
/** Maps the SDK's identifier-type union to the generated API enum. */
|
|
4
|
+
export declare const IDENTIFIER_TYPE_TO_API: Record<BusinessAccountSignerIdentifierType, UserIdentifierTypeEnum>;
|
|
5
|
+
//# sourceMappingURL=businessAccounts.constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"businessAccounts.constants.d.ts","sourceRoot":"","sources":["../../../../src/modules/waas/businessAccounts/businessAccounts.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,0BAA0B,CAAC;AAEpF,sEAAsE;AACtE,eAAO,MAAM,sBAAsB,EAAE,MAAM,CACzC,mCAAmC,EACnC,sBAAsB,CAQvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transferBusinessAccountOwnership.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/transferBusinessAccountOwnership/transferBusinessAccountOwnership.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,KAAK,sCAAsC,GAAG;IAC5C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,gCAAgC,0CACJ,sCAAsC,WACrE,aAAa,KACpB,OAAO,CAAC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"transferBusinessAccountOwnership.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/transferBusinessAccountOwnership/transferBusinessAccountOwnership.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,KAAK,sCAAsC,GAAG;IAC5C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,gCAAgC,0CACJ,sCAAsC,WACrE,aAAa,KACpB,OAAO,CAAC,qBAAqB,CAmB/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/updateBusinessAccount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { DynamicClient } from '../../../../client/types';
|
|
2
|
+
import type { BusinessAccount } from '../businessAccounts.types';
|
|
3
|
+
type UpdateBusinessAccountParams = {
|
|
4
|
+
businessAccountId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Renames a business account (owner-/admin-only). Calls the SDK API directly
|
|
9
|
+
* (no MPC step), so a rejection surfaces as a thrown error.
|
|
10
|
+
*
|
|
11
|
+
* @param params.businessAccountId - The business account to rename.
|
|
12
|
+
* @param params.name - The new name.
|
|
13
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
14
|
+
* @returns The updated business account.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* await updateBusinessAccount({ businessAccountId, name: 'Acme Inc' });
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @see getBusinessAccount
|
|
22
|
+
* @notInstrumented
|
|
23
|
+
*/
|
|
24
|
+
export declare const updateBusinessAccount: ({ businessAccountId, name }: UpdateBusinessAccountParams, client?: DynamicClient) => Promise<BusinessAccount>;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=updateBusinessAccount.d.ts.map
|
package/dist/modules/waas/businessAccounts/updateBusinessAccount/updateBusinessAccount.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateBusinessAccount.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/updateBusinessAccount/updateBusinessAccount.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,KAAK,2BAA2B,GAAG;IACjC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,qBAAqB,gCACH,2BAA2B,WAChD,aAAa,KACpB,OAAO,CAAC,eAAe,CAWzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/updateBusinessAccountMemberRole/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { DynamicClient } from '../../../../client/types';
|
|
2
|
+
import type { BusinessAccountMember, BusinessAccountMemberRole } from '../businessAccounts.types';
|
|
3
|
+
/** Roles a member can be reassigned to — owner moves only via transferOwnership. */
|
|
4
|
+
type AssignableRole = Exclude<BusinessAccountMemberRole, 'owner'>;
|
|
5
|
+
type UpdateBusinessAccountMemberRoleParams = {
|
|
6
|
+
businessAccountId: string;
|
|
7
|
+
role: AssignableRole;
|
|
8
|
+
userId: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Changes an existing member's role between `admin` and `viewer` (owner-/admin-only).
|
|
12
|
+
* Owner is not assignable here — use `transferBusinessAccountOwnership` for that.
|
|
13
|
+
*
|
|
14
|
+
* @param params.businessAccountId - The business account the member belongs to.
|
|
15
|
+
* @param params.userId - The member whose role changes.
|
|
16
|
+
* @param params.role - The new role (`admin` or `viewer`).
|
|
17
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
18
|
+
* @returns The updated business account member.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* await updateBusinessAccountMemberRole({
|
|
23
|
+
* businessAccountId,
|
|
24
|
+
* userId: member.userId,
|
|
25
|
+
* role: 'admin',
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @see transferBusinessAccountOwnership
|
|
30
|
+
* @see addBusinessAccountMember
|
|
31
|
+
* @notInstrumented
|
|
32
|
+
*/
|
|
33
|
+
export declare const updateBusinessAccountMemberRole: ({ businessAccountId, userId, role }: UpdateBusinessAccountMemberRoleParams, client?: DynamicClient) => Promise<BusinessAccountMember>;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=updateBusinessAccountMemberRole.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateBusinessAccountMemberRole.d.ts","sourceRoot":"","sources":["../../../../../src/modules/waas/businessAccounts/updateBusinessAccountMemberRole/updateBusinessAccountMemberRole.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EACV,qBAAqB,EACrB,yBAAyB,EAC1B,MAAM,2BAA2B,CAAC;AAEnC,oFAAoF;AACpF,KAAK,cAAc,GAAG,OAAO,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;AAElE,KAAK,qCAAqC,GAAG;IAC3C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAQF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,+BAA+B,wCACL,qCAAqC,WAClE,aAAa,KACpB,OAAO,CAAC,qBAAqB,CAY/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createWaasProvider.d.ts","sourceRoot":"","sources":["../../../../src/modules/waas/createWaasProvider/createWaasProvider.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAMzE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAMzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAKlD,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF,uBAAuB;AACvB,eAAO,MAAM,kBAAkB,0BAG5B,wBAAwB,KAAG,
|
|
1
|
+
{"version":3,"file":"createWaasProvider.d.ts","sourceRoot":"","sources":["../../../../src/modules/waas/createWaasProvider/createWaasProvider.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAMzE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAMzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAKlD,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF,uBAAuB;AACvB,eAAO,MAAM,kBAAkB,0BAG5B,wBAAwB,KAAG,YAinB7B,CAAC"}
|
|
@@ -22,7 +22,7 @@ type VerifyWalletAccountParams = {
|
|
|
22
22
|
* @param [params.requestedScopes] - Optional token scopes to request during verification.
|
|
23
23
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
24
24
|
* @returns A promise that resolves to the verified wallet account.
|
|
25
|
-
* @throws WalletAccountAlreadyVerifiedError If the wallet is already verified.
|
|
25
|
+
* @throws WalletAccountAlreadyVerifiedError If the wallet is already verified and no requestedScopes are provided.
|
|
26
26
|
* @throws WalletAlreadyLinkedToAnotherUserError If the wallet is linked to another user.
|
|
27
27
|
* @see connectWithWalletProvider
|
|
28
28
|
* @see connectAndVerifyWithWalletProvider
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifyWalletAccountForSignInOrTransfer.d.ts","sourceRoot":"","sources":["../../../../src/modules/wallets/verifyWalletAccountForSignInOrTransfer/verifyWalletAccountForSignInOrTransfer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAG7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAW3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAItD,KAAK,4CAA4C,GAAG;IAClD,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,UAAU,EAAE,CAAC;IAC/B,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF,uBAAuB;AACvB,eAAO,MAAM,sCAAsC,oDAK9C,4CAA4C,UACvC,aAAa,KACpB,OAAO,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"verifyWalletAccountForSignInOrTransfer.d.ts","sourceRoot":"","sources":["../../../../src/modules/wallets/verifyWalletAccountForSignInOrTransfer/verifyWalletAccountForSignInOrTransfer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAG7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAW3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAItD,KAAK,4CAA4C,GAAG;IAClD,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,UAAU,EAAE,CAAC;IAC/B,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF,uBAAuB;AACvB,eAAO,MAAM,sCAAsC,oDAK9C,4CAA4C,UACvC,aAAa,KACpB,OAAO,CAAC,aAAa,CAiHvB,CAAC"}
|