@dynamic-labs-sdk/client 1.12.1 → 1.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{InvalidParamError-I6NfUdQL.esm.js → InvalidParamError-B0nAZ6Ei.esm.js} +35 -5
- package/dist/InvalidParamError-B0nAZ6Ei.esm.js.map +1 -0
- package/dist/{InvalidParamError-d0WFn5Ai.cjs → InvalidParamError-DDdAeFXE.cjs} +41 -5
- package/dist/InvalidParamError-DDdAeFXE.cjs.map +1 -0
- package/dist/{InvalidParamError-CKUis748.native.esm.js → InvalidParamError-DbUJgYDE.native.esm.js} +21 -3
- package/dist/InvalidParamError-DbUJgYDE.native.esm.js.map +1 -0
- package/dist/core.cjs +5 -5
- package/dist/core.esm.js +5 -5
- package/dist/core.native.esm.js +7 -7
- package/dist/core.native.esm.js.map +1 -1
- package/dist/errors/WaasOnboardingIncompleteError.d.ts +18 -0
- package/dist/errors/WaasOnboardingIncompleteError.d.ts.map +1 -0
- package/dist/exports/index.d.ts +1 -0
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-CfW0tOnr.cjs → getNetworkProviderFromNetworkId-1j3BPA22.cjs} +4 -4
- package/dist/{getNetworkProviderFromNetworkId-CfW0tOnr.cjs.map → getNetworkProviderFromNetworkId-1j3BPA22.cjs.map} +1 -1
- package/dist/{getNetworkProviderFromNetworkId-DpiVLfs_.native.esm.js → getNetworkProviderFromNetworkId-CMBk4NzR.native.esm.js} +8 -8
- package/dist/getNetworkProviderFromNetworkId-CMBk4NzR.native.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-D6ABmeNQ.esm.js → getNetworkProviderFromNetworkId-DaMxnWPo.esm.js} +3 -3
- package/dist/{getNetworkProviderFromNetworkId-D6ABmeNQ.esm.js.map → getNetworkProviderFromNetworkId-DaMxnWPo.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-IEoo2Kv9.esm.js → getSignedSessionId-BRklPjP0.esm.js} +3 -3
- package/dist/{getSignedSessionId-IEoo2Kv9.esm.js.map → getSignedSessionId-BRklPjP0.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-Bc-sYE2A.cjs → getSignedSessionId-BU81jCyQ.cjs} +3 -3
- package/dist/{getSignedSessionId-Bc-sYE2A.cjs.map → getSignedSessionId-BU81jCyQ.cjs.map} +1 -1
- package/dist/{getSignedSessionId-C6LJdiSK.native.esm.js → getSignedSessionId-DPj38qtY.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-C6LJdiSK.native.esm.js.map → getSignedSessionId-DPj38qtY.native.esm.js.map} +1 -1
- package/dist/{getWaasWalletProviderFromWalletAccount-DojjjSIP.esm.js → getWaasWalletProviderFromWalletAccount-BhgXIVZM.native.esm.js} +3 -3
- package/dist/{getWaasWalletProviderFromWalletAccount-D1wxsNEI.native.esm.js.map → getWaasWalletProviderFromWalletAccount-BhgXIVZM.native.esm.js.map} +1 -1
- package/dist/{getWaasWalletProviderFromWalletAccount-D1wxsNEI.native.esm.js → getWaasWalletProviderFromWalletAccount-JN5ZC71J.esm.js} +3 -3
- package/dist/{getWaasWalletProviderFromWalletAccount-DojjjSIP.esm.js.map → getWaasWalletProviderFromWalletAccount-JN5ZC71J.esm.js.map} +1 -1
- package/dist/{getWaasWalletProviderFromWalletAccount-CSmVAhr2.cjs → getWaasWalletProviderFromWalletAccount-aRoo7mw8.cjs} +3 -3
- package/dist/{getWaasWalletProviderFromWalletAccount-CSmVAhr2.cjs.map → getWaasWalletProviderFromWalletAccount-aRoo7mw8.cjs.map} +1 -1
- package/dist/{getWalletProviderByKey-RTW-S68o.native.esm.js → getWalletProviderByKey-BKRul8sp.native.esm.js} +17 -23
- package/dist/getWalletProviderByKey-BKRul8sp.native.esm.js.map +1 -0
- package/dist/{getWalletProviderByKey-DsTEubkT.esm.js → getWalletProviderByKey-C-HHI7L8.esm.js} +3 -21
- package/dist/getWalletProviderByKey-C-HHI7L8.esm.js.map +1 -0
- package/dist/{getWalletProviderByKey-B821GpaI.cjs → getWalletProviderByKey-z1nf15R8.cjs} +4 -28
- package/dist/getWalletProviderByKey-z1nf15R8.cjs.map +1 -0
- package/dist/index.cjs +16 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +8 -62
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +11 -65
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isDynamicWaasEnabled-CBLpFRnd.native.esm.js → isDynamicWaasEnabled-9I4iE0Ko.native.esm.js} +2 -2
- package/dist/{isDynamicWaasEnabled-CBLpFRnd.native.esm.js.map → isDynamicWaasEnabled-9I4iE0Ko.native.esm.js.map} +1 -1
- package/dist/{isDynamicWaasEnabled-CBOG0ITH.cjs → isDynamicWaasEnabled-DDbRfcN3.cjs} +3 -3
- package/dist/{isDynamicWaasEnabled-CBOG0ITH.cjs.map → isDynamicWaasEnabled-DDbRfcN3.cjs.map} +1 -1
- package/dist/{isDynamicWaasEnabled-vRyWP-1l.esm.js → isDynamicWaasEnabled-DvC45F05.esm.js} +2 -2
- package/dist/{isDynamicWaasEnabled-vRyWP-1l.esm.js.map → isDynamicWaasEnabled-DvC45F05.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-D1AYL99a.native.esm.js → isMfaRequiredForAction-B8d2MBRx.native.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-D1AYL99a.native.esm.js.map → isMfaRequiredForAction-B8d2MBRx.native.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-C1-1spV9.esm.js → isMfaRequiredForAction-BAqo9eBq.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-C1-1spV9.esm.js.map → isMfaRequiredForAction-BAqo9eBq.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-DL013-fR.cjs → isMfaRequiredForAction-YGaK8XRO.cjs} +2 -2
- package/dist/{isMfaRequiredForAction-DL013-fR.cjs.map → isMfaRequiredForAction-YGaK8XRO.cjs.map} +1 -1
- package/dist/isUserOnboardingComplete-BT_SR4m_.esm.js +121 -0
- package/dist/isUserOnboardingComplete-BT_SR4m_.esm.js.map +1 -0
- package/dist/isUserOnboardingComplete-Bo9grSze.cjs +151 -0
- package/dist/isUserOnboardingComplete-Bo9grSze.cjs.map +1 -0
- package/dist/isUserOnboardingComplete-CVHzzTtG.native.esm.js +121 -0
- package/dist/isUserOnboardingComplete-CVHzzTtG.native.esm.js.map +1 -0
- package/dist/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.d.ts +9 -2
- package/dist/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.d.ts.map +1 -1
- package/dist/modules/waas/createWaasProvider/createWaasProvider.d.ts.map +1 -1
- package/dist/modules/wallets/getWalletAccounts/getWalletAccountsFromState/getWalletAccountsFromState.d.ts.map +1 -1
- package/dist/{refreshAuth-tjEnkc58.cjs → refreshAuth-C0kN3RBN.cjs} +3 -3
- package/dist/{refreshAuth-tjEnkc58.cjs.map → refreshAuth-C0kN3RBN.cjs.map} +1 -1
- package/dist/{refreshAuth-BWQWl4uA.esm.js → refreshAuth-CfpOd4qg.esm.js} +3 -3
- package/dist/{refreshAuth-BWQWl4uA.esm.js.map → refreshAuth-CfpOd4qg.esm.js.map} +1 -1
- package/dist/{refreshAuth-D8UjWFLB.native.esm.js → refreshAuth-Ck5OyzzC.native.esm.js} +3 -3
- package/dist/{refreshAuth-D8UjWFLB.native.esm.js.map → refreshAuth-Ck5OyzzC.native.esm.js.map} +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/waas.cjs +6 -6
- package/dist/waas.esm.js +5 -5
- package/dist/waas.native.esm.js +5 -5
- package/dist/waasCore.cjs +8 -7
- package/dist/waasCore.cjs.map +1 -1
- package/dist/waasCore.esm.js +7 -6
- package/dist/waasCore.esm.js.map +1 -1
- package/dist/waasCore.native.esm.js +7 -6
- package/dist/waasCore.native.esm.js.map +1 -1
- package/package.json +2 -2
- package/dist/InvalidParamError-CKUis748.native.esm.js.map +0 -1
- package/dist/InvalidParamError-I6NfUdQL.esm.js.map +0 -1
- package/dist/InvalidParamError-d0WFn5Ai.cjs.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-DpiVLfs_.native.esm.js.map +0 -1
- package/dist/getWalletProviderByKey-B821GpaI.cjs.map +0 -1
- package/dist/getWalletProviderByKey-DsTEubkT.esm.js.map +0 -1
- package/dist/getWalletProviderByKey-RTW-S68o.native.esm.js.map +0 -1
- package/dist/preconnectWaasIframe-BnyTG4Wy.native.esm.js +0 -31
- package/dist/preconnectWaasIframe-BnyTG4Wy.native.esm.js.map +0 -1
- package/dist/preconnectWaasIframe-DWYWeLor.cjs +0 -37
- package/dist/preconnectWaasIframe-DWYWeLor.cjs.map +0 -1
- package/dist/preconnectWaasIframe-Dn3RrrHd.esm.js +0 -31
- package/dist/preconnectWaasIframe-Dn3RrrHd.esm.js.map +0 -1
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-YGaK8XRO.cjs');
|
|
2
|
+
const require_InvalidParamError = require('./InvalidParamError-DDdAeFXE.cjs');
|
|
3
|
+
const require_isDynamicWaasEnabled = require('./isDynamicWaasEnabled-DDbRfcN3.cjs');
|
|
4
|
+
let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
|
|
5
|
+
let _dynamic_labs_wallet_browser_wallet_client = require("@dynamic-labs-wallet/browser-wallet-client");
|
|
6
|
+
|
|
7
|
+
//#region src/errors/WaasOnboardingIncompleteError.ts
|
|
8
|
+
/**
|
|
9
|
+
* Thrown when the embedded (WaaS) wallet client is requested before the user
|
|
10
|
+
* has completed onboarding — i.e. the JWT has not upgraded to `user:basic`
|
|
11
|
+
* because MFA, KYC, recovery-codes acknowledgment, or device registration is
|
|
12
|
+
* still pending.
|
|
13
|
+
*
|
|
14
|
+
* The WaaS iframe's init-time room-cache pre-warm fires `createRooms` using the
|
|
15
|
+
* token captured at client construction (before any per-operation token
|
|
16
|
+
* resync). Building the client during this window lets that pre-warm fire with
|
|
17
|
+
* a pre-`user:basic` token, get a 401, and the iframe's unauthorized handler
|
|
18
|
+
* force-logs-out the user. Throwing here surfaces a clear, recoverable reason
|
|
19
|
+
* instead — wait for onboarding to complete and retry.
|
|
20
|
+
*/
|
|
21
|
+
var WaasOnboardingIncompleteError = class extends require_InvalidParamError.BaseError {
|
|
22
|
+
constructor() {
|
|
23
|
+
super({
|
|
24
|
+
cause: null,
|
|
25
|
+
code: "waas_onboarding_incomplete",
|
|
26
|
+
docsUrl: null,
|
|
27
|
+
name: "WaasOnboardingIncompleteError",
|
|
28
|
+
shortMessage: "Cannot create or access the embedded wallet until onboarding is complete (pending MFA, KYC, recovery-codes acknowledgment, or device registration)."
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/modules/waas/preconnectWaasIframe/preconnectWaasIframe.ts
|
|
35
|
+
/**
|
|
36
|
+
* Warms the browser's connection (DNS + TCP + TLS) to the embedded-wallet
|
|
37
|
+
* iframe origin so the iframe mounted after authentication completes loads on
|
|
38
|
+
* a hot connection. Called when an auth flow starts (OTP send/verify, social
|
|
39
|
+
* callback). Safe to call repeatedly; no-op on React Native / SSR and when
|
|
40
|
+
* Dynamic WaaS is not enabled.
|
|
41
|
+
*
|
|
42
|
+
* @param client - The Dynamic client instance.
|
|
43
|
+
* @not-instrumented
|
|
44
|
+
*/
|
|
45
|
+
const preconnectWaasIframe = (client) => {
|
|
46
|
+
const core = require_InvalidParamError.getCore(client);
|
|
47
|
+
try {
|
|
48
|
+
if (!require_isDynamicWaasEnabled.isDynamicWaasEnabled(client)) return;
|
|
49
|
+
(0, _dynamic_labs_wallet_browser_wallet_client.preconnectWaasIframe)({
|
|
50
|
+
authMode: require_InvalidParamError.isCookieEnabled(client) ? "cookie" : "header",
|
|
51
|
+
baseApiUrl: (core.apiBaseUrl || require_InvalidParamError.DEFAULT_WAAS_BASE_API_URL).replace("/api/v0", "")
|
|
52
|
+
});
|
|
53
|
+
} catch (error) {
|
|
54
|
+
core.logger.warn("[preconnectWaasIframe] skipped", error);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.ts
|
|
60
|
+
/**
|
|
61
|
+
* Checks if device registration is required for the given user.
|
|
62
|
+
*
|
|
63
|
+
* This function determines if the user has the deviceRegistration
|
|
64
|
+
* scope, indicating that device registration is required.
|
|
65
|
+
*
|
|
66
|
+
* @param user - The user to check.
|
|
67
|
+
* @returns True if device registration is required, false otherwise.
|
|
68
|
+
* @not-instrumented
|
|
69
|
+
*/
|
|
70
|
+
const isDeviceRegistrationRequired = (user) => Boolean(user.scope?.includes("device:register"));
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/modules/mfa/isPendingRecoveryCodesAcknowledgment/isPendingRecoveryCodesAcknowledgment.ts
|
|
74
|
+
/**
|
|
75
|
+
* Checks if the user is still pending acknowledgment of their MFA recovery codes.
|
|
76
|
+
*
|
|
77
|
+
* This function determines whether the user has been presented with recovery
|
|
78
|
+
* codes that they have not yet acknowledged as saved or backed up.
|
|
79
|
+
*
|
|
80
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
81
|
+
* @returns True if recovery codes are pending acknowledgment, false otherwise.
|
|
82
|
+
* @not-instrumented
|
|
83
|
+
*/
|
|
84
|
+
const isPendingRecoveryCodesAcknowledgment = (client = require_InvalidParamError.getDefaultClient()) => {
|
|
85
|
+
const user = client.user;
|
|
86
|
+
require_InvalidParamError.assertDefined(user, "User not logged in");
|
|
87
|
+
return user.mfaBackupCodeAcknowledgement === _dynamic_labs_sdk_api_core.MfaBackupCodeAcknowledgement.Pending;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.ts
|
|
92
|
+
/**
|
|
93
|
+
* Checks if the user has completed all onboarding requirements.
|
|
94
|
+
*
|
|
95
|
+
* This function verifies whether a user has fulfilled all necessary requirements
|
|
96
|
+
* including KYC fields (Know Your Customer information), MFA setup
|
|
97
|
+
* (Multi-Factor Authentication including recovery codes acknowledgment), and
|
|
98
|
+
* device registration.
|
|
99
|
+
*
|
|
100
|
+
* A `false` result means the user still has an outstanding onboarding step, so
|
|
101
|
+
* any feature that requires a fully onboarded (`user:basic`) user should hold
|
|
102
|
+
* off until it returns `true`. Creating or accessing an embedded (WaaS) wallet
|
|
103
|
+
* is one such feature — its backend calls reject a pre-`user:basic` token — but
|
|
104
|
+
* this predicate is general and not specific to embedded wallets.
|
|
105
|
+
*
|
|
106
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
107
|
+
* @returns True if onboarding is complete (no pending requirements), false if there are pending requirements.
|
|
108
|
+
* @not-instrumented
|
|
109
|
+
*/
|
|
110
|
+
const isUserOnboardingComplete = (client = require_InvalidParamError.getDefaultClient()) => {
|
|
111
|
+
const user = client.user;
|
|
112
|
+
require_InvalidParamError.assertDefined(user, "User not logged in");
|
|
113
|
+
const hasMissingKycFields = Boolean(user.missingFields?.length);
|
|
114
|
+
const hasPendingMfaAuth = require_InvalidParamError.isUserMissingMfaAuth(client);
|
|
115
|
+
const hasPendingRecoveryCodes = isPendingRecoveryCodesAcknowledgment(client);
|
|
116
|
+
const hasPendingDeviceRegistration = isDeviceRegistrationRequired(user);
|
|
117
|
+
return !hasMissingKycFields && !hasPendingMfaAuth && !hasPendingRecoveryCodes && !hasPendingDeviceRegistration;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
//#endregion
|
|
121
|
+
Object.defineProperty(exports, 'WaasOnboardingIncompleteError', {
|
|
122
|
+
enumerable: true,
|
|
123
|
+
get: function () {
|
|
124
|
+
return WaasOnboardingIncompleteError;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
Object.defineProperty(exports, 'isDeviceRegistrationRequired', {
|
|
128
|
+
enumerable: true,
|
|
129
|
+
get: function () {
|
|
130
|
+
return isDeviceRegistrationRequired;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
Object.defineProperty(exports, 'isPendingRecoveryCodesAcknowledgment', {
|
|
134
|
+
enumerable: true,
|
|
135
|
+
get: function () {
|
|
136
|
+
return isPendingRecoveryCodesAcknowledgment;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
Object.defineProperty(exports, 'isUserOnboardingComplete', {
|
|
140
|
+
enumerable: true,
|
|
141
|
+
get: function () {
|
|
142
|
+
return isUserOnboardingComplete;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
Object.defineProperty(exports, 'preconnectWaasIframe', {
|
|
146
|
+
enumerable: true,
|
|
147
|
+
get: function () {
|
|
148
|
+
return preconnectWaasIframe;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
//# sourceMappingURL=isUserOnboardingComplete-Bo9grSze.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isUserOnboardingComplete-Bo9grSze.cjs","names":["BaseError","getCore","isDynamicWaasEnabled","isCookieEnabled","DEFAULT_WAAS_BASE_API_URL","getDefaultClient","MfaBackupCodeAcknowledgement","getDefaultClient","isUserMissingMfaAuth"],"sources":["../src/errors/WaasOnboardingIncompleteError.ts","../src/modules/waas/preconnectWaasIframe/preconnectWaasIframe.ts","../src/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.ts","../src/modules/mfa/isPendingRecoveryCodesAcknowledgment/isPendingRecoveryCodesAcknowledgment.ts","../src/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.ts"],"sourcesContent":["import { BaseError } from './base';\n\n/**\n * Thrown when the embedded (WaaS) wallet client is requested before the user\n * has completed onboarding — i.e. the JWT has not upgraded to `user:basic`\n * because MFA, KYC, recovery-codes acknowledgment, or device registration is\n * still pending.\n *\n * The WaaS iframe's init-time room-cache pre-warm fires `createRooms` using the\n * token captured at client construction (before any per-operation token\n * resync). Building the client during this window lets that pre-warm fire with\n * a pre-`user:basic` token, get a 401, and the iframe's unauthorized handler\n * force-logs-out the user. Throwing here surfaces a clear, recoverable reason\n * instead — wait for onboarding to complete and retry.\n */\nexport class WaasOnboardingIncompleteError extends BaseError {\n constructor() {\n super({\n cause: null,\n code: 'waas_onboarding_incomplete',\n docsUrl: null,\n name: 'WaasOnboardingIncompleteError',\n shortMessage:\n 'Cannot create or access the embedded wallet until onboarding is complete (pending MFA, KYC, recovery-codes acknowledgment, or device registration).',\n });\n }\n}\n","import type { AuthMode } from '@dynamic-labs-wallet/browser-wallet-client';\nimport { preconnectWaasIframe as preconnectWaasIframeOrigin } from '@dynamic-labs-wallet/browser-wallet-client';\n\nimport { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { isCookieEnabled } from '../../projectSettings/isCookieEnabled';\nimport { DEFAULT_WAAS_BASE_API_URL } from '../constants';\nimport { isDynamicWaasEnabled } from '../isDynamicWaasEnabled';\n\n/**\n * Warms the browser's connection (DNS + TCP + TLS) to the embedded-wallet\n * iframe origin so the iframe mounted after authentication completes loads on\n * a hot connection. Called when an auth flow starts (OTP send/verify, social\n * callback). Safe to call repeatedly; no-op on React Native / SSR and when\n * Dynamic WaaS is not enabled.\n *\n * @param client - The Dynamic client instance.\n * @not-instrumented\n */\nexport const preconnectWaasIframe = (client: DynamicClient): void => {\n const core = getCore(client);\n try {\n if (!isDynamicWaasEnabled(client)) return;\n\n preconnectWaasIframeOrigin({\n authMode: (isCookieEnabled(client) ? 'cookie' : 'header') as AuthMode,\n baseApiUrl: (core.apiBaseUrl || DEFAULT_WAAS_BASE_API_URL).replace(\n '/api/v0',\n ''\n ),\n });\n } catch (error) {\n // Best-effort: never break the auth flow (also swallows the assertion\n // from isDynamicWaasEnabled when project settings are not loaded yet).\n core.logger.warn('[preconnectWaasIframe] skipped', error);\n }\n};\n","import type { User } from '../../user/user.types';\n\n/**\n * Checks if device registration is required for the given user.\n *\n * This function determines if the user has the deviceRegistration\n * scope, indicating that device registration is required.\n *\n * @param user - The user to check.\n * @returns True if device registration is required, false otherwise.\n * @not-instrumented\n */\nexport const isDeviceRegistrationRequired = (user: User) =>\n Boolean(user.scope?.includes('device:register'));\n","import { MfaBackupCodeAcknowledgement } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Checks if the user is still pending acknowledgment of their MFA recovery codes.\n *\n * This function determines whether the user has been presented with recovery\n * codes that they have not yet acknowledged as saved or backed up.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if recovery codes are pending acknowledgment, false otherwise.\n * @not-instrumented\n */\nexport const isPendingRecoveryCodesAcknowledgment = (\n client = getDefaultClient()\n) => {\n const user = client.user;\n\n assertDefined(user, 'User not logged in');\n\n return (\n user.mfaBackupCodeAcknowledgement === MfaBackupCodeAcknowledgement.Pending\n );\n};\n","import { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport { isDeviceRegistrationRequired } from '../../deviceRegistration/isDeviceRegistrationRequired';\nimport { isPendingRecoveryCodesAcknowledgment } from '../../mfa/isPendingRecoveryCodesAcknowledgment';\nimport { isUserMissingMfaAuth } from '../../mfa/isUserMissingMfaAuth';\n\n/**\n * Checks if the user has completed all onboarding requirements.\n *\n * This function verifies whether a user has fulfilled all necessary requirements\n * including KYC fields (Know Your Customer information), MFA setup\n * (Multi-Factor Authentication including recovery codes acknowledgment), and\n * device registration.\n *\n * A `false` result means the user still has an outstanding onboarding step, so\n * any feature that requires a fully onboarded (`user:basic`) user should hold\n * off until it returns `true`. Creating or accessing an embedded (WaaS) wallet\n * is one such feature — its backend calls reject a pre-`user:basic` token — but\n * this predicate is general and not specific to embedded wallets.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if onboarding is complete (no pending requirements), false if there are pending requirements.\n * @not-instrumented\n */\nexport const isUserOnboardingComplete = (client = getDefaultClient()) => {\n const user = client.user;\n\n assertDefined(user, 'User not logged in');\n\n const hasMissingKycFields = Boolean(user.missingFields?.length);\n const hasPendingMfaAuth = isUserMissingMfaAuth(client);\n const hasPendingRecoveryCodes = isPendingRecoveryCodesAcknowledgment(client);\n const hasPendingDeviceRegistration = isDeviceRegistrationRequired(user);\n\n const userOnboardingComplete =\n !hasMissingKycFields &&\n !hasPendingMfaAuth &&\n !hasPendingRecoveryCodes &&\n !hasPendingDeviceRegistration;\n\n return userOnboardingComplete;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAeA,IAAa,gCAAb,cAAmDA,oCAAU;CAC3D,cAAc;AACZ,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cACE;GACH,CAAC;;;;;;;;;;;;;;;;ACLN,MAAa,wBAAwB,WAAgC;CACnE,MAAM,OAAOC,kCAAQ,OAAO;AAC5B,KAAI;AACF,MAAI,CAACC,kDAAqB,OAAO,CAAE;AAEnC,uEAA2B;GACzB,UAAWC,0CAAgB,OAAO,GAAG,WAAW;GAChD,aAAa,KAAK,cAAcC,qDAA2B,QACzD,WACA,GACD;GACF,CAAC;UACK,OAAO;AAGd,OAAK,OAAO,KAAK,kCAAkC,MAAM;;;;;;;;;;;;;;;;ACtB7D,MAAa,gCAAgC,SAC3C,QAAQ,KAAK,OAAO,SAAS,kBAAkB,CAAC;;;;;;;;;;;;;;ACElD,MAAa,wCACX,SAASC,4CAAkB,KACxB;CACH,MAAM,OAAO,OAAO;AAEpB,yCAAc,MAAM,qBAAqB;AAEzC,QACE,KAAK,iCAAiCC,wDAA6B;;;;;;;;;;;;;;;;;;;;;;;ACCvE,MAAa,4BAA4B,SAASC,4CAAkB,KAAK;CACvE,MAAM,OAAO,OAAO;AAEpB,yCAAc,MAAM,qBAAqB;CAEzC,MAAM,sBAAsB,QAAQ,KAAK,eAAe,OAAO;CAC/D,MAAM,oBAAoBC,+CAAqB,OAAO;CACtD,MAAM,0BAA0B,qCAAqC,OAAO;CAC5E,MAAM,+BAA+B,6BAA6B,KAAK;AAQvE,QALE,CAAC,uBACD,CAAC,qBACD,CAAC,2BACD,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { $ as getCore, F as assertDefined, P as isCookieEnabled, Q as BaseError, Y as getDefaultClient, o as isUserMissingMfaAuth, r as DEFAULT_WAAS_BASE_API_URL } from "./InvalidParamError-DbUJgYDE.native.esm.js";
|
|
2
|
+
import { t as isDynamicWaasEnabled } from "./isDynamicWaasEnabled-9I4iE0Ko.native.esm.js";
|
|
3
|
+
import { MfaBackupCodeAcknowledgement } from "@dynamic-labs/sdk-api-core";
|
|
4
|
+
import { preconnectWaasIframe } from "@dynamic-labs-wallet/browser-wallet-client";
|
|
5
|
+
|
|
6
|
+
//#region src/errors/WaasOnboardingIncompleteError.ts
|
|
7
|
+
/**
|
|
8
|
+
* Thrown when the embedded (WaaS) wallet client is requested before the user
|
|
9
|
+
* has completed onboarding — i.e. the JWT has not upgraded to `user:basic`
|
|
10
|
+
* because MFA, KYC, recovery-codes acknowledgment, or device registration is
|
|
11
|
+
* still pending.
|
|
12
|
+
*
|
|
13
|
+
* The WaaS iframe's init-time room-cache pre-warm fires `createRooms` using the
|
|
14
|
+
* token captured at client construction (before any per-operation token
|
|
15
|
+
* resync). Building the client during this window lets that pre-warm fire with
|
|
16
|
+
* a pre-`user:basic` token, get a 401, and the iframe's unauthorized handler
|
|
17
|
+
* force-logs-out the user. Throwing here surfaces a clear, recoverable reason
|
|
18
|
+
* instead — wait for onboarding to complete and retry.
|
|
19
|
+
*/
|
|
20
|
+
var WaasOnboardingIncompleteError = class extends BaseError {
|
|
21
|
+
constructor() {
|
|
22
|
+
super({
|
|
23
|
+
cause: null,
|
|
24
|
+
code: "waas_onboarding_incomplete",
|
|
25
|
+
docsUrl: null,
|
|
26
|
+
name: "WaasOnboardingIncompleteError",
|
|
27
|
+
shortMessage: "Cannot create or access the embedded wallet until onboarding is complete (pending MFA, KYC, recovery-codes acknowledgment, or device registration)."
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/modules/waas/preconnectWaasIframe/preconnectWaasIframe.ts
|
|
34
|
+
/**
|
|
35
|
+
* Warms the browser's connection (DNS + TCP + TLS) to the embedded-wallet
|
|
36
|
+
* iframe origin so the iframe mounted after authentication completes loads on
|
|
37
|
+
* a hot connection. Called when an auth flow starts (OTP send/verify, social
|
|
38
|
+
* callback). Safe to call repeatedly; no-op on React Native / SSR and when
|
|
39
|
+
* Dynamic WaaS is not enabled.
|
|
40
|
+
*
|
|
41
|
+
* @param client - The Dynamic client instance.
|
|
42
|
+
* @not-instrumented
|
|
43
|
+
*/
|
|
44
|
+
const preconnectWaasIframe$1 = (client) => {
|
|
45
|
+
const core = getCore(client);
|
|
46
|
+
try {
|
|
47
|
+
if (!isDynamicWaasEnabled(client)) return;
|
|
48
|
+
preconnectWaasIframe({
|
|
49
|
+
authMode: isCookieEnabled(client) ? "cookie" : "header",
|
|
50
|
+
baseApiUrl: (core.apiBaseUrl || DEFAULT_WAAS_BASE_API_URL).replace("/api/v0", "")
|
|
51
|
+
});
|
|
52
|
+
} catch (error) {
|
|
53
|
+
core.logger.warn("[preconnectWaasIframe] skipped", error);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.ts
|
|
59
|
+
/**
|
|
60
|
+
* Checks if device registration is required for the given user.
|
|
61
|
+
*
|
|
62
|
+
* This function determines if the user has the deviceRegistration
|
|
63
|
+
* scope, indicating that device registration is required.
|
|
64
|
+
*
|
|
65
|
+
* @param user - The user to check.
|
|
66
|
+
* @returns True if device registration is required, false otherwise.
|
|
67
|
+
* @not-instrumented
|
|
68
|
+
*/
|
|
69
|
+
const isDeviceRegistrationRequired = (user) => Boolean(user.scope?.includes("device:register"));
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/modules/mfa/isPendingRecoveryCodesAcknowledgment/isPendingRecoveryCodesAcknowledgment.ts
|
|
73
|
+
/**
|
|
74
|
+
* Checks if the user is still pending acknowledgment of their MFA recovery codes.
|
|
75
|
+
*
|
|
76
|
+
* This function determines whether the user has been presented with recovery
|
|
77
|
+
* codes that they have not yet acknowledged as saved or backed up.
|
|
78
|
+
*
|
|
79
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
80
|
+
* @returns True if recovery codes are pending acknowledgment, false otherwise.
|
|
81
|
+
* @not-instrumented
|
|
82
|
+
*/
|
|
83
|
+
const isPendingRecoveryCodesAcknowledgment = (client = getDefaultClient()) => {
|
|
84
|
+
const user = client.user;
|
|
85
|
+
assertDefined(user, "User not logged in");
|
|
86
|
+
return user.mfaBackupCodeAcknowledgement === MfaBackupCodeAcknowledgement.Pending;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.ts
|
|
91
|
+
/**
|
|
92
|
+
* Checks if the user has completed all onboarding requirements.
|
|
93
|
+
*
|
|
94
|
+
* This function verifies whether a user has fulfilled all necessary requirements
|
|
95
|
+
* including KYC fields (Know Your Customer information), MFA setup
|
|
96
|
+
* (Multi-Factor Authentication including recovery codes acknowledgment), and
|
|
97
|
+
* device registration.
|
|
98
|
+
*
|
|
99
|
+
* A `false` result means the user still has an outstanding onboarding step, so
|
|
100
|
+
* any feature that requires a fully onboarded (`user:basic`) user should hold
|
|
101
|
+
* off until it returns `true`. Creating or accessing an embedded (WaaS) wallet
|
|
102
|
+
* is one such feature — its backend calls reject a pre-`user:basic` token — but
|
|
103
|
+
* this predicate is general and not specific to embedded wallets.
|
|
104
|
+
*
|
|
105
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
106
|
+
* @returns True if onboarding is complete (no pending requirements), false if there are pending requirements.
|
|
107
|
+
* @not-instrumented
|
|
108
|
+
*/
|
|
109
|
+
const isUserOnboardingComplete = (client = getDefaultClient()) => {
|
|
110
|
+
const user = client.user;
|
|
111
|
+
assertDefined(user, "User not logged in");
|
|
112
|
+
const hasMissingKycFields = Boolean(user.missingFields?.length);
|
|
113
|
+
const hasPendingMfaAuth = isUserMissingMfaAuth(client);
|
|
114
|
+
const hasPendingRecoveryCodes = isPendingRecoveryCodesAcknowledgment(client);
|
|
115
|
+
const hasPendingDeviceRegistration = isDeviceRegistrationRequired(user);
|
|
116
|
+
return !hasMissingKycFields && !hasPendingMfaAuth && !hasPendingRecoveryCodes && !hasPendingDeviceRegistration;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
//#endregion
|
|
120
|
+
export { WaasOnboardingIncompleteError as a, preconnectWaasIframe$1 as i, isPendingRecoveryCodesAcknowledgment as n, isDeviceRegistrationRequired as r, isUserOnboardingComplete as t };
|
|
121
|
+
//# sourceMappingURL=isUserOnboardingComplete-CVHzzTtG.native.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isUserOnboardingComplete-CVHzzTtG.native.esm.js","names":["preconnectWaasIframe"],"sources":["../src/errors/WaasOnboardingIncompleteError.ts","../src/modules/waas/preconnectWaasIframe/preconnectWaasIframe.ts","../src/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.ts","../src/modules/mfa/isPendingRecoveryCodesAcknowledgment/isPendingRecoveryCodesAcknowledgment.ts","../src/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.ts"],"sourcesContent":["import { BaseError } from './base';\n\n/**\n * Thrown when the embedded (WaaS) wallet client is requested before the user\n * has completed onboarding — i.e. the JWT has not upgraded to `user:basic`\n * because MFA, KYC, recovery-codes acknowledgment, or device registration is\n * still pending.\n *\n * The WaaS iframe's init-time room-cache pre-warm fires `createRooms` using the\n * token captured at client construction (before any per-operation token\n * resync). Building the client during this window lets that pre-warm fire with\n * a pre-`user:basic` token, get a 401, and the iframe's unauthorized handler\n * force-logs-out the user. Throwing here surfaces a clear, recoverable reason\n * instead — wait for onboarding to complete and retry.\n */\nexport class WaasOnboardingIncompleteError extends BaseError {\n constructor() {\n super({\n cause: null,\n code: 'waas_onboarding_incomplete',\n docsUrl: null,\n name: 'WaasOnboardingIncompleteError',\n shortMessage:\n 'Cannot create or access the embedded wallet until onboarding is complete (pending MFA, KYC, recovery-codes acknowledgment, or device registration).',\n });\n }\n}\n","import type { AuthMode } from '@dynamic-labs-wallet/browser-wallet-client';\nimport { preconnectWaasIframe as preconnectWaasIframeOrigin } from '@dynamic-labs-wallet/browser-wallet-client';\n\nimport { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { isCookieEnabled } from '../../projectSettings/isCookieEnabled';\nimport { DEFAULT_WAAS_BASE_API_URL } from '../constants';\nimport { isDynamicWaasEnabled } from '../isDynamicWaasEnabled';\n\n/**\n * Warms the browser's connection (DNS + TCP + TLS) to the embedded-wallet\n * iframe origin so the iframe mounted after authentication completes loads on\n * a hot connection. Called when an auth flow starts (OTP send/verify, social\n * callback). Safe to call repeatedly; no-op on React Native / SSR and when\n * Dynamic WaaS is not enabled.\n *\n * @param client - The Dynamic client instance.\n * @not-instrumented\n */\nexport const preconnectWaasIframe = (client: DynamicClient): void => {\n const core = getCore(client);\n try {\n if (!isDynamicWaasEnabled(client)) return;\n\n preconnectWaasIframeOrigin({\n authMode: (isCookieEnabled(client) ? 'cookie' : 'header') as AuthMode,\n baseApiUrl: (core.apiBaseUrl || DEFAULT_WAAS_BASE_API_URL).replace(\n '/api/v0',\n ''\n ),\n });\n } catch (error) {\n // Best-effort: never break the auth flow (also swallows the assertion\n // from isDynamicWaasEnabled when project settings are not loaded yet).\n core.logger.warn('[preconnectWaasIframe] skipped', error);\n }\n};\n","import type { User } from '../../user/user.types';\n\n/**\n * Checks if device registration is required for the given user.\n *\n * This function determines if the user has the deviceRegistration\n * scope, indicating that device registration is required.\n *\n * @param user - The user to check.\n * @returns True if device registration is required, false otherwise.\n * @not-instrumented\n */\nexport const isDeviceRegistrationRequired = (user: User) =>\n Boolean(user.scope?.includes('device:register'));\n","import { MfaBackupCodeAcknowledgement } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Checks if the user is still pending acknowledgment of their MFA recovery codes.\n *\n * This function determines whether the user has been presented with recovery\n * codes that they have not yet acknowledged as saved or backed up.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if recovery codes are pending acknowledgment, false otherwise.\n * @not-instrumented\n */\nexport const isPendingRecoveryCodesAcknowledgment = (\n client = getDefaultClient()\n) => {\n const user = client.user;\n\n assertDefined(user, 'User not logged in');\n\n return (\n user.mfaBackupCodeAcknowledgement === MfaBackupCodeAcknowledgement.Pending\n );\n};\n","import { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport { isDeviceRegistrationRequired } from '../../deviceRegistration/isDeviceRegistrationRequired';\nimport { isPendingRecoveryCodesAcknowledgment } from '../../mfa/isPendingRecoveryCodesAcknowledgment';\nimport { isUserMissingMfaAuth } from '../../mfa/isUserMissingMfaAuth';\n\n/**\n * Checks if the user has completed all onboarding requirements.\n *\n * This function verifies whether a user has fulfilled all necessary requirements\n * including KYC fields (Know Your Customer information), MFA setup\n * (Multi-Factor Authentication including recovery codes acknowledgment), and\n * device registration.\n *\n * A `false` result means the user still has an outstanding onboarding step, so\n * any feature that requires a fully onboarded (`user:basic`) user should hold\n * off until it returns `true`. Creating or accessing an embedded (WaaS) wallet\n * is one such feature — its backend calls reject a pre-`user:basic` token — but\n * this predicate is general and not specific to embedded wallets.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if onboarding is complete (no pending requirements), false if there are pending requirements.\n * @not-instrumented\n */\nexport const isUserOnboardingComplete = (client = getDefaultClient()) => {\n const user = client.user;\n\n assertDefined(user, 'User not logged in');\n\n const hasMissingKycFields = Boolean(user.missingFields?.length);\n const hasPendingMfaAuth = isUserMissingMfaAuth(client);\n const hasPendingRecoveryCodes = isPendingRecoveryCodesAcknowledgment(client);\n const hasPendingDeviceRegistration = isDeviceRegistrationRequired(user);\n\n const userOnboardingComplete =\n !hasMissingKycFields &&\n !hasPendingMfaAuth &&\n !hasPendingRecoveryCodes &&\n !hasPendingDeviceRegistration;\n\n return userOnboardingComplete;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAeA,IAAa,gCAAb,cAAmD,UAAU;CAC3D,cAAc;AACZ,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cACE;GACH,CAAC;;;;;;;;;;;;;;;;ACLN,MAAaA,0BAAwB,WAAgC;CACnE,MAAM,OAAO,QAAQ,OAAO;AAC5B,KAAI;AACF,MAAI,CAAC,qBAAqB,OAAO,CAAE;AAEnC,uBAA2B;GACzB,UAAW,gBAAgB,OAAO,GAAG,WAAW;GAChD,aAAa,KAAK,cAAc,2BAA2B,QACzD,WACA,GACD;GACF,CAAC;UACK,OAAO;AAGd,OAAK,OAAO,KAAK,kCAAkC,MAAM;;;;;;;;;;;;;;;;ACtB7D,MAAa,gCAAgC,SAC3C,QAAQ,KAAK,OAAO,SAAS,kBAAkB,CAAC;;;;;;;;;;;;;;ACElD,MAAa,wCACX,SAAS,kBAAkB,KACxB;CACH,MAAM,OAAO,OAAO;AAEpB,eAAc,MAAM,qBAAqB;AAEzC,QACE,KAAK,iCAAiC,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;ACCvE,MAAa,4BAA4B,SAAS,kBAAkB,KAAK;CACvE,MAAM,OAAO,OAAO;AAEpB,eAAc,MAAM,qBAAqB;CAEzC,MAAM,sBAAsB,QAAQ,KAAK,eAAe,OAAO;CAC/D,MAAM,oBAAoB,qBAAqB,OAAO;CACtD,MAAM,0BAA0B,qCAAqC,OAAO;CAC5E,MAAM,+BAA+B,6BAA6B,KAAK;AAQvE,QALE,CAAC,uBACD,CAAC,qBACD,CAAC,2BACD,CAAC"}
|
|
@@ -2,8 +2,15 @@
|
|
|
2
2
|
* Checks if the user has completed all onboarding requirements.
|
|
3
3
|
*
|
|
4
4
|
* This function verifies whether a user has fulfilled all necessary requirements
|
|
5
|
-
* including KYC fields (Know Your Customer information)
|
|
6
|
-
* (Multi-Factor Authentication including recovery codes acknowledgment)
|
|
5
|
+
* including KYC fields (Know Your Customer information), MFA setup
|
|
6
|
+
* (Multi-Factor Authentication including recovery codes acknowledgment), and
|
|
7
|
+
* device registration.
|
|
8
|
+
*
|
|
9
|
+
* A `false` result means the user still has an outstanding onboarding step, so
|
|
10
|
+
* any feature that requires a fully onboarded (`user:basic`) user should hold
|
|
11
|
+
* off until it returns `true`. Creating or accessing an embedded (WaaS) wallet
|
|
12
|
+
* is one such feature — its backend calls reject a pre-`user:basic` token — but
|
|
13
|
+
* this predicate is general and not specific to embedded wallets.
|
|
7
14
|
*
|
|
8
15
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
9
16
|
* @returns True if onboarding is complete (no pending requirements), false if there are pending requirements.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isUserOnboardingComplete.d.ts","sourceRoot":"","sources":["../../../../src/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isUserOnboardingComplete.d.ts","sourceRoot":"","sources":["../../../../src/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,wBAAwB,gEAiBpC,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;
|
|
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;AAIzE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAMzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAIlD,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF,wBAAwB;AACxB,eAAO,MAAM,kBAAkB,0BAG5B,wBAAwB,KAAG,YAma7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getWalletAccountsFromState.d.ts","sourceRoot":"","sources":["../../../../../src/modules/wallets/getWalletAccounts/getWalletAccountsFromState/getWalletAccountsFromState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"getWalletAccountsFromState.d.ts","sourceRoot":"","sources":["../../../../../src/modules/wallets/getWalletAccounts/getWalletAccountsFromState/getWalletAccountsFromState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAI1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAG9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,KAAK,gCAAgC,GAAG;IACtC,wBAAwB,EAAE,uBAAuB,EAAE,CAAC;IACpD,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF,wBAAwB;AACxB,eAAO,MAAM,0BAA0B,uCACD,gCAAgC,UAC5D,aAAa,KACpB,aAAa,EAoDf,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_InvalidParamError = require('./InvalidParamError-
|
|
2
|
-
const require_getWalletProviderByKey = require('./getWalletProviderByKey-
|
|
1
|
+
const require_InvalidParamError = require('./InvalidParamError-DDdAeFXE.cjs');
|
|
2
|
+
const require_getWalletProviderByKey = require('./getWalletProviderByKey-z1nf15R8.cjs');
|
|
3
3
|
|
|
4
4
|
//#region src/modules/user/refreshAuth/refreshAuth.ts
|
|
5
5
|
/**
|
|
@@ -40,4 +40,4 @@ Object.defineProperty(exports, '__refreshAuth_wrapped', {
|
|
|
40
40
|
return __refreshAuth_wrapped;
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
//# sourceMappingURL=refreshAuth-
|
|
43
|
+
//# sourceMappingURL=refreshAuth-C0kN3RBN.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refreshAuth-
|
|
1
|
+
{"version":3,"file":"refreshAuth-C0kN3RBN.cjs","names":[],"sources":["../src/modules/user/refreshAuth/refreshAuth.ts"],"sourcesContent":["import type { VerifyResponse } from '@dynamic-labs/sdk-api-core';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\nimport { updateAuthFromVerifyResponse } from '../../auth/updateAuthFromVerifyResponse';\n\n/**\n * Refreshes the current user's data from the server.\n *\n * This function fetches the latest user information and token from the backend\n * updating the local user and token states with any changes.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the verify response.\n * @instrumented\n * @redact-params\n */\nexport const refreshAuth = async (\n client = getDefaultClient()\n): Promise<VerifyResponse> => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const response = await apiClient.refreshAuth({\n environmentId: core.environmentId,\n });\n\n updateAuthFromVerifyResponse({ response }, client);\n\n return response;\n};\n"],"mappings":";;;;;;;;;;;;;;;AAqBA,MAAE,cAAa,OACb,SAAM,4CAAY;CAElB,MAAM,OAAA,kCAAW,OAAM;wBACN,0CAAK,EAAa,EAAA,OAAA,eAGnC,eAAA,KAAA;AAGD,6DAAA,EAAA,UAAA,EAAA,OAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as updateAuthFromVerifyResponse } from "./getWalletProviderByKey-
|
|
1
|
+
import { J as instrumentFunction, at as getDefaultClient, j as createApiClient, lt as getCore } from "./InvalidParamError-B0nAZ6Ei.esm.js";
|
|
2
|
+
import { r as updateAuthFromVerifyResponse } from "./getWalletProviderByKey-C-HHI7L8.esm.js";
|
|
3
3
|
|
|
4
4
|
//#region src/modules/user/refreshAuth/refreshAuth.ts
|
|
5
5
|
/**
|
|
@@ -35,4 +35,4 @@ const __refreshAuth_wrapped = instrumentFunction({
|
|
|
35
35
|
|
|
36
36
|
//#endregion
|
|
37
37
|
export { __refreshAuth_wrapped as t };
|
|
38
|
-
//# sourceMappingURL=refreshAuth-
|
|
38
|
+
//# sourceMappingURL=refreshAuth-CfpOd4qg.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refreshAuth-
|
|
1
|
+
{"version":3,"file":"refreshAuth-CfpOd4qg.esm.js","names":[],"sources":["../src/modules/user/refreshAuth/refreshAuth.ts"],"sourcesContent":["import type { VerifyResponse } from '@dynamic-labs/sdk-api-core';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\nimport { updateAuthFromVerifyResponse } from '../../auth/updateAuthFromVerifyResponse';\n\n/**\n * Refreshes the current user's data from the server.\n *\n * This function fetches the latest user information and token from the backend\n * updating the local user and token states with any changes.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the verify response.\n * @instrumented\n * @redact-params\n */\nexport const refreshAuth = async (\n client = getDefaultClient()\n): Promise<VerifyResponse> => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const response = await apiClient.refreshAuth({\n environmentId: core.environmentId,\n });\n\n updateAuthFromVerifyResponse({ response }, client);\n\n return response;\n};\n"],"mappings":";;;;;;;;;;;;;;;AAqBA,MAAE,cAAa,OACb,SAAM,kBAAY;CAElB,MAAM,OAAA,QAAW,OAAM;wBACN,gBAAK,EAAa,EAAA,OAAA,eAGnC,eAAA,KAAA;AAGD,8BAAA,EAAA,UAAA,EAAA,OAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as updateAuthFromVerifyResponse } from "./getWalletProviderByKey-
|
|
1
|
+
import { $ as getCore, R as instrumentFunction, Y as getDefaultClient, x as createApiClient } from "./InvalidParamError-DbUJgYDE.native.esm.js";
|
|
2
|
+
import { r as updateAuthFromVerifyResponse } from "./getWalletProviderByKey-BKRul8sp.native.esm.js";
|
|
3
3
|
|
|
4
4
|
//#region src/modules/user/refreshAuth/refreshAuth.ts
|
|
5
5
|
/**
|
|
@@ -35,4 +35,4 @@ const __refreshAuth_wrapped = instrumentFunction({
|
|
|
35
35
|
|
|
36
36
|
//#endregion
|
|
37
37
|
export { __refreshAuth_wrapped as t };
|
|
38
|
-
//# sourceMappingURL=refreshAuth-
|
|
38
|
+
//# sourceMappingURL=refreshAuth-Ck5OyzzC.native.esm.js.map
|
package/dist/{refreshAuth-D8UjWFLB.native.esm.js.map → refreshAuth-Ck5OyzzC.native.esm.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refreshAuth-
|
|
1
|
+
{"version":3,"file":"refreshAuth-Ck5OyzzC.native.esm.js","names":[],"sources":["../src/modules/user/refreshAuth/refreshAuth.ts"],"sourcesContent":["import type { VerifyResponse } from '@dynamic-labs/sdk-api-core';\n\nimport { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\nimport { updateAuthFromVerifyResponse } from '../../auth/updateAuthFromVerifyResponse';\n\n/**\n * Refreshes the current user's data from the server.\n *\n * This function fetches the latest user information and token from the backend\n * updating the local user and token states with any changes.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the verify response.\n * @instrumented\n * @redact-params\n */\nexport const refreshAuth = async (\n client = getDefaultClient()\n): Promise<VerifyResponse> => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const response = await apiClient.refreshAuth({\n environmentId: core.environmentId,\n });\n\n updateAuthFromVerifyResponse({ response }, client);\n\n return response;\n};\n"],"mappings":";;;;;;;;;;;;;;;AAqBA,MAAE,cAAa,OACb,SAAM,kBAAY;CAElB,MAAM,OAAA,QAAW,OAAM;wBACN,gBAAK,EAAa,EAAA,OAAA,eAGnC,eAAA,KAAA;AAGD,8BAAA,EAAA,UAAA,EAAA,OAAA"}
|