@dynamic-labs-sdk/client 0.18.0 → 0.18.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/{InvalidParamError-Bxg4p9zQ.cjs.js → InvalidParamError-0w8-q2f3.cjs.js} +4 -4
- package/dist/{InvalidParamError-Bxg4p9zQ.cjs.js.map → InvalidParamError-0w8-q2f3.cjs.js.map} +1 -1
- package/dist/{InvalidParamError-ByAOflE2.esm.js → InvalidParamError-CGBIFNgP.esm.js} +3 -3
- package/dist/{InvalidParamError-ByAOflE2.esm.js.map → InvalidParamError-CGBIFNgP.esm.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-DMFf5i7j.esm.js → NotWaasWalletAccountError-CT_IUD-3.esm.js} +3 -3
- package/dist/{NotWaasWalletAccountError-DMFf5i7j.esm.js.map → NotWaasWalletAccountError-CT_IUD-3.esm.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-2CU35ult.cjs.js → NotWaasWalletAccountError-CyvI1KtC.cjs.js} +3 -3
- package/dist/{NotWaasWalletAccountError-2CU35ult.cjs.js.map → NotWaasWalletAccountError-CyvI1KtC.cjs.js.map} +1 -1
- package/dist/core.cjs.js +5 -5
- package/dist/core.esm.js +5 -5
- package/dist/exports/index.d.ts +6 -5
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-6QbuR0_i.esm.js → getNetworkProviderFromNetworkId-C9PJejYH.esm.js} +3 -3
- package/dist/{getNetworkProviderFromNetworkId-6QbuR0_i.esm.js.map → getNetworkProviderFromNetworkId-C9PJejYH.esm.js.map} +1 -1
- package/dist/{getNetworkProviderFromNetworkId-BXH2tfrn.cjs.js → getNetworkProviderFromNetworkId-KrwFxKlq.cjs.js} +3 -3
- package/dist/{getNetworkProviderFromNetworkId-BXH2tfrn.cjs.js.map → getNetworkProviderFromNetworkId-KrwFxKlq.cjs.js.map} +1 -1
- package/dist/{getSignedSessionId-KSSnmfwN.cjs.js → getSignedSessionId-Cqp6g3pY.cjs.js} +3 -3
- package/dist/{getSignedSessionId-KSSnmfwN.cjs.js.map → getSignedSessionId-Cqp6g3pY.cjs.js.map} +1 -1
- package/dist/{getSignedSessionId-yWd9_5u4.esm.js → getSignedSessionId-DhCbpycv.esm.js} +3 -3
- package/dist/{getSignedSessionId-yWd9_5u4.esm.js.map → getSignedSessionId-DhCbpycv.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-DbfbxLr9.esm.js → getVerifiedCredentialForWalletAccount-BdoPoNic.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-DbfbxLr9.esm.js.map → getVerifiedCredentialForWalletAccount-BdoPoNic.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-CJAgL4AJ.cjs.js → getVerifiedCredentialForWalletAccount-Bffr91SM.cjs.js} +3 -3
- package/dist/{getVerifiedCredentialForWalletAccount-CJAgL4AJ.cjs.js.map → getVerifiedCredentialForWalletAccount-Bffr91SM.cjs.js.map} +1 -1
- package/dist/index.cjs.js +78 -18
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +78 -19
- package/dist/index.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-CG5JbTh1.esm.js → isMfaRequiredForAction-Vo0fCwzo.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-CG5JbTh1.esm.js.map → isMfaRequiredForAction-Vo0fCwzo.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-DnZ2ZWUB.cjs.js → isMfaRequiredForAction-cPUOtGku.cjs.js} +2 -2
- package/dist/{isMfaRequiredForAction-DnZ2ZWUB.cjs.js.map → isMfaRequiredForAction-cPUOtGku.cjs.js.map} +1 -1
- package/dist/modules/auth/checkStepUpAuth/checkStepUpAuth.d.ts +35 -0
- package/dist/modules/auth/checkStepUpAuth/checkStepUpAuth.d.ts.map +1 -0
- package/dist/modules/auth/checkStepUpAuth/index.d.ts +2 -0
- package/dist/modules/auth/checkStepUpAuth/index.d.ts.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/waas.cjs.js +4 -4
- package/dist/waas.esm.js +3 -3
- package/dist/waasCore.cjs.js +4 -4
- package/dist/waasCore.esm.js +3 -3
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-
|
|
2
|
-
const require_InvalidParamError = require('./InvalidParamError-
|
|
3
|
-
const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-
|
|
4
|
-
const require_NotWaasWalletAccountError = require('./NotWaasWalletAccountError-
|
|
5
|
-
const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-
|
|
1
|
+
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-KrwFxKlq.cjs.js');
|
|
2
|
+
const require_InvalidParamError = require('./InvalidParamError-0w8-q2f3.cjs.js');
|
|
3
|
+
const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-Bffr91SM.cjs.js');
|
|
4
|
+
const require_NotWaasWalletAccountError = require('./NotWaasWalletAccountError-CyvI1KtC.cjs.js');
|
|
5
|
+
const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-cPUOtGku.cjs.js');
|
|
6
6
|
let _dynamic_labs_sdk_assert_package_version = require("@dynamic-labs-sdk/assert-package-version");
|
|
7
7
|
let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
|
|
8
8
|
let zod_mini = require("zod/mini");
|
|
@@ -1559,6 +1559,65 @@ var WalletProviderMethodUnavailableError = class extends require_InvalidParamErr
|
|
|
1559
1559
|
}
|
|
1560
1560
|
};
|
|
1561
1561
|
|
|
1562
|
+
//#endregion
|
|
1563
|
+
//#region src/modules/auth/checkStepUpAuth/checkStepUpAuth.ts
|
|
1564
|
+
const STEP_UP_REQUIRED_DEFAULT = {
|
|
1565
|
+
credentials: [],
|
|
1566
|
+
isRequired: true
|
|
1567
|
+
};
|
|
1568
|
+
/**
|
|
1569
|
+
* Checks whether step-up authentication is required for a given scope
|
|
1570
|
+
* and returns the available credentials to satisfy it.
|
|
1571
|
+
*
|
|
1572
|
+
* First performs a fast local check — if a valid elevated access token already
|
|
1573
|
+
* exists for the scope, returns `{ isRequired: false }` immediately without
|
|
1574
|
+
* an API call.
|
|
1575
|
+
*
|
|
1576
|
+
* Otherwise, calls the backend `stepUp/check` endpoint which evaluates
|
|
1577
|
+
* feature flags, SDK version, MFA settings, and action-based requirements
|
|
1578
|
+
* to determine if step-up is needed. The response includes the available
|
|
1579
|
+
* credentials and a recommended default credential.
|
|
1580
|
+
*
|
|
1581
|
+
* If the request fails for any reason, defaults to `{ isRequired: true }`
|
|
1582
|
+
* as a safety measure.
|
|
1583
|
+
*
|
|
1584
|
+
* @param params.scope - The scope to check (e.g., 'wallet:export').
|
|
1585
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1586
|
+
* @returns The step-up check result with `isRequired`, `credentials`, and `defaultCredentialId`.
|
|
1587
|
+
*
|
|
1588
|
+
* @example
|
|
1589
|
+
* ```typescript
|
|
1590
|
+
* const result = await checkStepUpAuth({ scope: TokenScope.Walletexport });
|
|
1591
|
+
* if (result.isRequired) {
|
|
1592
|
+
* // Show step-up auth UI using result.credentials
|
|
1593
|
+
* }
|
|
1594
|
+
* ```
|
|
1595
|
+
* @instrumented
|
|
1596
|
+
*/
|
|
1597
|
+
const checkStepUpAuth = async ({ scope }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
1598
|
+
if (require_InvalidParamError.getElevatedAccessToken({
|
|
1599
|
+
consume: false,
|
|
1600
|
+
scope
|
|
1601
|
+
}, client)) return {
|
|
1602
|
+
credentials: [],
|
|
1603
|
+
isRequired: false
|
|
1604
|
+
};
|
|
1605
|
+
try {
|
|
1606
|
+
const core = require_InvalidParamError.getCore(client);
|
|
1607
|
+
const response = await require_InvalidParamError.createApiClient({}, client).stepUpCheck({
|
|
1608
|
+
environmentId: core.environmentId,
|
|
1609
|
+
stepUpCheckRequest: { scope }
|
|
1610
|
+
});
|
|
1611
|
+
return {
|
|
1612
|
+
credentials: response.credentials ?? [],
|
|
1613
|
+
defaultCredentialId: response.defaultCredentialId,
|
|
1614
|
+
isRequired: response.isRequired
|
|
1615
|
+
};
|
|
1616
|
+
} catch {
|
|
1617
|
+
return STEP_UP_REQUIRED_DEFAULT;
|
|
1618
|
+
}
|
|
1619
|
+
};
|
|
1620
|
+
|
|
1562
1621
|
//#endregion
|
|
1563
1622
|
//#region src/modules/auth/externalAuth/requestExternalAuthElevatedToken/requestExternalAuthElevatedToken.ts
|
|
1564
1623
|
/**
|
|
@@ -2727,30 +2786,30 @@ const getKrakenWhitelistedAddresses = async (client = require_InvalidParamError.
|
|
|
2727
2786
|
};
|
|
2728
2787
|
|
|
2729
2788
|
//#endregion
|
|
2730
|
-
//#region src/modules/
|
|
2789
|
+
//#region src/modules/initializeClient/waitForClientInitialized/waitForClientInitialized.ts
|
|
2731
2790
|
/**
|
|
2732
|
-
*
|
|
2791
|
+
* Allows waiting until all modules of the client have been properly initialized
|
|
2792
|
+
* and are ready for use.
|
|
2733
2793
|
*
|
|
2734
|
-
*
|
|
2735
|
-
* instrumented function call. When disabled, instrumented functions run
|
|
2736
|
-
* normally but emit no telemetry.
|
|
2794
|
+
* @returns a promise that resolves once the client is fully initialized.
|
|
2737
2795
|
* @instrumented
|
|
2738
2796
|
*/
|
|
2739
|
-
const
|
|
2740
|
-
require_InvalidParamError.getCore(client).
|
|
2797
|
+
const waitForClientInitialized = async (client = require_InvalidParamError.getDefaultClient()) => {
|
|
2798
|
+
await require_InvalidParamError.getCore(client).initTrack.waitForAll();
|
|
2741
2799
|
};
|
|
2742
2800
|
|
|
2743
2801
|
//#endregion
|
|
2744
|
-
//#region src/modules/
|
|
2802
|
+
//#region src/modules/instrumentation/setInstrumentationEnabled/setInstrumentationEnabled.ts
|
|
2745
2803
|
/**
|
|
2746
|
-
*
|
|
2747
|
-
* and are ready for use.
|
|
2804
|
+
* Enables or disables event collection for the client's instrumentation service.
|
|
2748
2805
|
*
|
|
2749
|
-
*
|
|
2806
|
+
* When enabled, events are forwarded to the configured transport on every
|
|
2807
|
+
* instrumented function call. When disabled, instrumented functions run
|
|
2808
|
+
* normally but emit no telemetry.
|
|
2750
2809
|
* @instrumented
|
|
2751
2810
|
*/
|
|
2752
|
-
const
|
|
2753
|
-
|
|
2811
|
+
const setInstrumentationEnabled = (enabled, client = require_InvalidParamError.getDefaultClient()) => {
|
|
2812
|
+
require_InvalidParamError.getCore(client).instrumentation.setEnabled(enabled);
|
|
2754
2813
|
};
|
|
2755
2814
|
|
|
2756
2815
|
//#endregion
|
|
@@ -5624,6 +5683,7 @@ exports.authenticateWithSocial = authenticateWithSocial;
|
|
|
5624
5683
|
exports.broadcastCheckoutTransaction = broadcastCheckoutTransaction;
|
|
5625
5684
|
exports.canConnectWithHardwareWallet = canConnectWithHardwareWallet;
|
|
5626
5685
|
exports.cancelCheckoutTransaction = cancelCheckoutTransaction;
|
|
5686
|
+
exports.checkStepUpAuth = checkStepUpAuth;
|
|
5627
5687
|
exports.completeDeviceRegistration = completeDeviceRegistration;
|
|
5628
5688
|
exports.completeSocialAuthentication = completeSocialAuthentication;
|
|
5629
5689
|
exports.connectAndVerifyWithWalletProvider = connectAndVerifyWithWalletProvider;
|