@dynamic-labs/sdk-react-core 4.19.5 → 4.19.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/package.cjs +3 -2
- package/package.js +3 -2
- package/package.json +13 -12
- package/src/functions.d.ts +1 -0
- package/src/lib/client/client.cjs +19 -0
- package/src/lib/client/client.d.ts +8 -0
- package/src/lib/client/client.js +11 -0
- package/src/lib/client/extension/constants.cjs +12 -0
- package/src/lib/client/extension/constants.d.ts +5 -0
- package/src/lib/client/extension/constants.js +8 -0
- package/src/lib/client/extension/index.d.ts +1 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/MockedFetchError.cjs +14 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/MockedFetchError.d.ts +4 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/MockedFetchError.js +10 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/fetchOverride.cjs +29 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/fetchOverride.d.ts +7 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/fetchOverride.js +25 -0
- package/src/lib/client/extension/useInitializeSdkClient/fetchOverride/index.d.ts +1 -0
- package/src/lib/client/extension/useInitializeSdkClient/index.d.ts +1 -0
- package/src/lib/client/extension/useInitializeSdkClient/useInitializeSdkClient.cjs +30 -0
- package/src/lib/client/extension/useInitializeSdkClient/useInitializeSdkClient.d.ts +2 -0
- package/src/lib/client/extension/useInitializeSdkClient/useInitializeSdkClient.js +26 -0
- package/src/lib/client/extension/utils/useClientState/index.d.ts +1 -0
- package/src/lib/client/extension/utils/useClientState/useClientState.d.ts +2 -0
- package/src/lib/components/AppOriginTile/AppOriginTile.cjs +8 -5
- package/src/lib/components/AppOriginTile/AppOriginTile.d.ts +4 -1
- package/src/lib/components/AppOriginTile/AppOriginTile.js +8 -5
- package/src/lib/components/Chip/Chip.cjs +2 -3
- package/src/lib/components/Chip/Chip.d.ts +5 -4
- package/src/lib/components/Chip/Chip.js +2 -3
- package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +3 -2
- package/src/lib/components/NeedHelpSection/NeedHelpSection.js +3 -2
- package/src/lib/context/DynamicContext/DynamicContext.cjs +3 -0
- package/src/lib/context/DynamicContext/DynamicContext.js +3 -0
- package/src/lib/context/OnrampContext/useEnabledOnrampProviders/useEnabledOnrampProviders.d.ts +2 -2
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/data/api/exchangeAccounts/exchangeAccounts.d.ts +45 -0
- package/src/lib/data/api/exchangeAccounts/index.d.ts +1 -0
- package/src/lib/data/api/index.d.ts +1 -0
- package/src/lib/data/api/onramp/onramp.d.ts +2 -2
- package/src/lib/locale/en/translation.cjs +16 -0
- package/src/lib/locale/en/translation.d.ts +16 -0
- package/src/lib/locale/en/translation.js +16 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +1 -1
- package/src/lib/modals/ZkSyncApprovalModal/ZkSyncApprovalModal.cjs +22 -0
- package/src/lib/modals/ZkSyncApprovalModal/ZkSyncApprovalModal.d.ts +8 -0
- package/src/lib/modals/ZkSyncApprovalModal/ZkSyncApprovalModal.js +18 -0
- package/src/lib/modals/ZkSyncApprovalModal/index.d.ts +1 -0
- package/src/lib/modals/index.d.ts +1 -0
- package/src/lib/shared/assets/backup.cjs +52 -0
- package/src/lib/shared/assets/backup.js +28 -0
- package/src/lib/shared/assets/clock.cjs +54 -0
- package/src/lib/shared/assets/clock.js +30 -0
- package/src/lib/shared/assets/index.d.ts +2 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/constants/authViewLayoutChecks.cjs +1 -0
- package/src/lib/utils/constants/authViewLayoutChecks.js +1 -0
- package/src/lib/utils/functions/getSessionInformation/getSessionInformation.cjs +4 -1
- package/src/lib/utils/functions/getSessionInformation/getSessionInformation.js +4 -1
- package/src/lib/utils/functions/onrampConfigurationToOnrampOption/onrampConfigurationToOnrampOption.d.ts +2 -2
- package/src/lib/utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.cjs +25 -18
- package/src/lib/utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.js +25 -18
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/unsetInitialWalletVerificationFlag/unsetInitialWalletVerificationFlag.cjs +9 -6
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/unsetInitialWalletVerificationFlag/unsetInitialWalletVerificationFlag.d.ts +8 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/unsetInitialWalletVerificationFlag/unsetInitialWalletVerificationFlag.js +8 -7
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +3 -2
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +4 -3
- package/src/lib/utils/hooks/index.d.ts +1 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +4 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +4 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +4 -1
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.d.ts +1 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +4 -1
- package/src/lib/utils/hooks/useExchangeAccounts/index.d.ts +1 -0
- package/src/lib/utils/hooks/useExchangeAccounts/useExchangeAccounts.d.ts +13 -0
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.cjs +4 -2
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.js +4 -2
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +12 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +12 -1
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.cjs +138 -0
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.d.ts +3 -0
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.js +133 -0
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +15 -88
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +15 -88
- package/src/lib/views/Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.js +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +1 -1
- package/src/lib/views/SessionKeyApprovalView/SessionKeyApprovalView.cjs +114 -0
- package/src/lib/views/SessionKeyApprovalView/SessionKeyApprovalView.js +110 -0
- package/src/lib/views/SessionPermissionsView/SessionPermissionsView.cjs +6 -6
- package/src/lib/views/SessionPermissionsView/SessionPermissionsView.js +2 -2
- package/src/lib/views/index.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.cjs +2 -0
- package/src/lib/views/viewToComponentMap.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/RevokeAccessView/RevokeAccessView.cjs +6 -4
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/RevokeAccessView/RevokeAccessView.js +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.19.7](https://github.com/dynamic-labs/dynamic-auth/compare/v4.19.6...v4.19.7) (2025-06-06)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add util to find waas wallets ([#8871](https://github.com/dynamic-labs/dynamic-auth/issues/8871)) ([2d7114e](https://github.com/dynamic-labs/dynamic-auth/commit/2d7114e51f5badf1d04600597f1fd9433fabf3d0))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* make sure smart account is deployed before creating sessions ([#8894](https://github.com/dynamic-labs/dynamic-auth/issues/8894)) ([5ba3d23](https://github.com/dynamic-labs/dynamic-auth/commit/5ba3d23bb8ef7c7438809128c8ef74c390ba1d48))
|
|
13
|
+
* only deploy zksync smart account if not deployed ([#8840](https://github.com/dynamic-labs/dynamic-auth/issues/8840)) ([66a306a](https://github.com/dynamic-labs/dynamic-auth/commit/66a306aaee25c58f685fa050a5d6aea79b196fce))
|
|
14
|
+
* primary wallet loading time when using React 19 ([#8896](https://github.com/dynamic-labs/dynamic-auth/issues/8896)) ([f5690f3](https://github.com/dynamic-labs/dynamic-auth/commit/f5690f31012e8fc6a5650423d4ece6c04f7c1811))
|
|
15
|
+
|
|
16
|
+
### [4.19.6](https://github.com/dynamic-labs/dynamic-auth/compare/v4.19.5...v4.19.6) (2025-06-04)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* backup unsuccessful popup when create wallet fails ([#8872](https://github.com/dynamic-labs/dynamic-auth/issues/8872)) ([c8f88f2](https://github.com/dynamic-labs/dynamic-auth/commit/c8f88f2cafdb7856764305764a230e159f09dadf))
|
|
22
|
+
* **global-wallet:** new native api method to return the eoa wallet for a connected smart wallet ([#8864](https://github.com/dynamic-labs/dynamic-auth/issues/8864)) ([5d0e200](https://github.com/dynamic-labs/dynamic-auth/commit/5d0e2002caefb658f6120b102abe145d6caafaf4))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* dont call select endpoint when signing in with 7702 wallet ([#8854](https://github.com/dynamic-labs/dynamic-auth/issues/8854)) ([9828a8f](https://github.com/dynamic-labs/dynamic-auth/commit/9828a8fb758b07dd4dc51cb9eadee483b884defe))
|
|
28
|
+
|
|
2
29
|
### [4.19.5](https://github.com/dynamic-labs/dynamic-auth/compare/v4.19.4...v4.19.5) (2025-06-02)
|
|
3
30
|
|
|
4
31
|
|
package/package.cjs
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var version = "4.19.
|
|
6
|
+
var version = "4.19.7";
|
|
7
7
|
var dependencies = {
|
|
8
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
8
|
+
"@dynamic-labs/sdk-api-core": "0.0.681",
|
|
9
|
+
"@dynamic-labs-sdk/client": "0.0.1-alpha.5",
|
|
9
10
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
10
11
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
11
12
|
"country-list": "2.3.0",
|
package/package.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
var version = "4.19.
|
|
2
|
+
var version = "4.19.7";
|
|
3
3
|
var dependencies = {
|
|
4
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
4
|
+
"@dynamic-labs/sdk-api-core": "0.0.681",
|
|
5
|
+
"@dynamic-labs-sdk/client": "0.0.1-alpha.5",
|
|
5
6
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
6
7
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
7
8
|
"country-list": "2.3.0",
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.19.
|
|
3
|
+
"version": "4.19.7",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
5
|
+
"@dynamic-labs/sdk-api-core": "0.0.681",
|
|
6
|
+
"@dynamic-labs-sdk/client": "0.0.1-alpha.5",
|
|
6
7
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
7
8
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
8
9
|
"country-list": "2.3.0",
|
|
@@ -14,16 +15,16 @@
|
|
|
14
15
|
"yup": "0.32.11",
|
|
15
16
|
"react-international-phone": "4.2.5",
|
|
16
17
|
"bs58": "5.0.0",
|
|
17
|
-
"@dynamic-labs/assert-package-version": "4.19.
|
|
18
|
-
"@dynamic-labs/iconic": "4.19.
|
|
19
|
-
"@dynamic-labs/logger": "4.19.
|
|
20
|
-
"@dynamic-labs/multi-wallet": "4.19.
|
|
21
|
-
"@dynamic-labs/rpc-providers": "4.19.
|
|
22
|
-
"@dynamic-labs/store": "4.19.
|
|
23
|
-
"@dynamic-labs/types": "4.19.
|
|
24
|
-
"@dynamic-labs/utils": "4.19.
|
|
25
|
-
"@dynamic-labs/wallet-book": "4.19.
|
|
26
|
-
"@dynamic-labs/wallet-connector-core": "4.19.
|
|
18
|
+
"@dynamic-labs/assert-package-version": "4.19.7",
|
|
19
|
+
"@dynamic-labs/iconic": "4.19.7",
|
|
20
|
+
"@dynamic-labs/logger": "4.19.7",
|
|
21
|
+
"@dynamic-labs/multi-wallet": "4.19.7",
|
|
22
|
+
"@dynamic-labs/rpc-providers": "4.19.7",
|
|
23
|
+
"@dynamic-labs/store": "4.19.7",
|
|
24
|
+
"@dynamic-labs/types": "4.19.7",
|
|
25
|
+
"@dynamic-labs/utils": "4.19.7",
|
|
26
|
+
"@dynamic-labs/wallet-book": "4.19.7",
|
|
27
|
+
"@dynamic-labs/wallet-connector-core": "4.19.7",
|
|
27
28
|
"eventemitter3": "5.0.1"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getProjectSettings } from './lib/store/state/projectSettings';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
require('react');
|
|
7
|
+
var EventEmitter = require('eventemitter3');
|
|
8
|
+
require('@dynamic-labs/utils');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var EventEmitter__default = /*#__PURE__*/_interopDefaultLegacy(EventEmitter);
|
|
13
|
+
|
|
14
|
+
const clientEmitter = new EventEmitter__default["default"]();
|
|
15
|
+
const setClient = (newClient) => {
|
|
16
|
+
clientEmitter.emit('changed', newClient);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
exports.setClient = setClient;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DynamicClient } from '@dynamic-labs-sdk/client';
|
|
2
|
+
export declare const setClient: (newClient: DynamicClient) => void;
|
|
3
|
+
export declare const getClient: () => DynamicClient;
|
|
4
|
+
/**
|
|
5
|
+
* Not many customers will ever change the client mid execution, but demo v2 will.
|
|
6
|
+
* That means we need hooks that can react to client changes.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useClient: () => DynamicClient;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import 'react';
|
|
3
|
+
import EventEmitter from 'eventemitter3';
|
|
4
|
+
import '@dynamic-labs/utils';
|
|
5
|
+
|
|
6
|
+
const clientEmitter = new EventEmitter();
|
|
7
|
+
const setClient = (newClient) => {
|
|
8
|
+
clientEmitter.emit('changed', newClient);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { setClient };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The name for the extension that this package creates to
|
|
8
|
+
* integrate with the Client SDK.
|
|
9
|
+
*/
|
|
10
|
+
const CLIENT_EXTENSION_NAME = 'sdk-react-core-integration';
|
|
11
|
+
|
|
12
|
+
exports.CLIENT_EXTENSION_NAME = CLIENT_EXTENSION_NAME;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useInitializeSdkClient } from './useInitializeSdkClient';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var utils = require('@dynamic-labs/utils');
|
|
7
|
+
|
|
8
|
+
class MockedFetchError extends utils.DynamicError {
|
|
9
|
+
constructor(req) {
|
|
10
|
+
super(`MockedFetchError — the Dynamic SDK Client request is being mocked: ${req.toString()}`);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
exports.MockedFetchError = MockedFetchError;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { DynamicError } from '@dynamic-labs/utils';
|
|
3
|
+
|
|
4
|
+
class MockedFetchError extends DynamicError {
|
|
5
|
+
constructor(req) {
|
|
6
|
+
super(`MockedFetchError — the Dynamic SDK Client request is being mocked: ${req.toString()}`);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { MockedFetchError };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
7
|
+
var MockedFetchError = require('./MockedFetchError.cjs');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Applies mock responses to requests that are not expected to be while in dog-feeding phase of the SDK.
|
|
11
|
+
*
|
|
12
|
+
* While dog-feeding is not complete, we must keep the client from doing anything other than
|
|
13
|
+
* what it should be doing.
|
|
14
|
+
*/
|
|
15
|
+
const fetchOverride = (req) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
// For now, we are handling JWT revoke in sdk-react-core.
|
|
17
|
+
if (req.toString().includes('revoke')) {
|
|
18
|
+
return new Response(null, { status: 200 });
|
|
19
|
+
}
|
|
20
|
+
// This endpoint is frequently hit so we mock it directly instead of returning the MockedFetchError
|
|
21
|
+
// to avoid spamming the console with errors.
|
|
22
|
+
if (req.toString().includes('settings')) {
|
|
23
|
+
return new Response(JSON.stringify(null), { status: 200 });
|
|
24
|
+
}
|
|
25
|
+
// Any other requests would be unexpected, so we throw an error to ensure they get visibility.
|
|
26
|
+
throw new MockedFetchError.MockedFetchError(req);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
exports.fetchOverride = fetchOverride;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Applies mock responses to requests that are not expected to be while in dog-feeding phase of the SDK.
|
|
3
|
+
*
|
|
4
|
+
* While dog-feeding is not complete, we must keep the client from doing anything other than
|
|
5
|
+
* what it should be doing.
|
|
6
|
+
*/
|
|
7
|
+
export declare const fetchOverride: (req: RequestInfo) => Promise<Response>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
3
|
+
import { MockedFetchError } from './MockedFetchError.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Applies mock responses to requests that are not expected to be while in dog-feeding phase of the SDK.
|
|
7
|
+
*
|
|
8
|
+
* While dog-feeding is not complete, we must keep the client from doing anything other than
|
|
9
|
+
* what it should be doing.
|
|
10
|
+
*/
|
|
11
|
+
const fetchOverride = (req) => __awaiter(void 0, void 0, void 0, function* () {
|
|
12
|
+
// For now, we are handling JWT revoke in sdk-react-core.
|
|
13
|
+
if (req.toString().includes('revoke')) {
|
|
14
|
+
return new Response(null, { status: 200 });
|
|
15
|
+
}
|
|
16
|
+
// This endpoint is frequently hit so we mock it directly instead of returning the MockedFetchError
|
|
17
|
+
// to avoid spamming the console with errors.
|
|
18
|
+
if (req.toString().includes('settings')) {
|
|
19
|
+
return new Response(JSON.stringify(null), { status: 200 });
|
|
20
|
+
}
|
|
21
|
+
// Any other requests would be unexpected, so we throw an error to ensure they get visibility.
|
|
22
|
+
throw new MockedFetchError(req);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export { fetchOverride };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './fetchOverride';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useInitializeSdkClient';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var client = require('@dynamic-labs-sdk/client');
|
|
8
|
+
var core = require('@dynamic-labs-sdk/client/core');
|
|
9
|
+
var client$1 = require('../../client.cjs');
|
|
10
|
+
var constants = require('../constants.cjs');
|
|
11
|
+
var fetchOverride = require('./fetchOverride/fetchOverride.cjs');
|
|
12
|
+
|
|
13
|
+
const useInitializeSdkClient = ({ settings }) => {
|
|
14
|
+
const lastClientDependencyKey = React.useRef(null);
|
|
15
|
+
const clientDependencyKey = [
|
|
16
|
+
settings.apiBaseUrl,
|
|
17
|
+
settings.environmentId,
|
|
18
|
+
].join('-');
|
|
19
|
+
if (lastClientDependencyKey.current === clientDependencyKey)
|
|
20
|
+
return;
|
|
21
|
+
lastClientDependencyKey.current = clientDependencyKey;
|
|
22
|
+
const newClient = client.createDynamicClient({
|
|
23
|
+
coreConfig: { apiBaseUrl: settings.apiBaseUrl, fetch: fetchOverride.fetchOverride },
|
|
24
|
+
environmentId: settings.environmentId,
|
|
25
|
+
});
|
|
26
|
+
client$1.setClient(newClient);
|
|
27
|
+
core.registerExtension(newClient, constants.CLIENT_EXTENSION_NAME);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.useInitializeSdkClient = useInitializeSdkClient;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { createDynamicClient } from '@dynamic-labs-sdk/client';
|
|
4
|
+
import { registerExtension } from '@dynamic-labs-sdk/client/core';
|
|
5
|
+
import { setClient } from '../../client.js';
|
|
6
|
+
import { CLIENT_EXTENSION_NAME } from '../constants.js';
|
|
7
|
+
import { fetchOverride } from './fetchOverride/fetchOverride.js';
|
|
8
|
+
|
|
9
|
+
const useInitializeSdkClient = ({ settings }) => {
|
|
10
|
+
const lastClientDependencyKey = useRef(null);
|
|
11
|
+
const clientDependencyKey = [
|
|
12
|
+
settings.apiBaseUrl,
|
|
13
|
+
settings.environmentId,
|
|
14
|
+
].join('-');
|
|
15
|
+
if (lastClientDependencyKey.current === clientDependencyKey)
|
|
16
|
+
return;
|
|
17
|
+
lastClientDependencyKey.current = clientDependencyKey;
|
|
18
|
+
const newClient = createDynamicClient({
|
|
19
|
+
coreConfig: { apiBaseUrl: settings.apiBaseUrl, fetch: fetchOverride },
|
|
20
|
+
environmentId: settings.environmentId,
|
|
21
|
+
});
|
|
22
|
+
setClient(newClient);
|
|
23
|
+
registerExtension(newClient, CLIENT_EXTENSION_NAME);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { useInitializeSdkClient };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useClientState';
|
|
@@ -10,18 +10,21 @@ var Typography = require('../Typography/Typography.cjs');
|
|
|
10
10
|
var Chip = require('../Chip/Chip.cjs');
|
|
11
11
|
var getGlobalWalletContext = require('../../shared/utils/functions/getGlobalWalletContext/getGlobalWalletContext.cjs');
|
|
12
12
|
|
|
13
|
-
const AppOriginTile = () => {
|
|
13
|
+
const AppOriginTile = ({ origin }) => {
|
|
14
14
|
const { requesterOrigin } = getGlobalWalletContext.getGlobalWalletContext();
|
|
15
|
-
const
|
|
15
|
+
const displayOrigin = React.useMemo(() => {
|
|
16
|
+
if (origin) {
|
|
17
|
+
return origin;
|
|
18
|
+
}
|
|
16
19
|
if (requesterOrigin) {
|
|
17
20
|
return requesterOrigin;
|
|
18
21
|
}
|
|
19
22
|
return utils.PlatformService.getDisplayOrigin();
|
|
20
|
-
}, [requesterOrigin]);
|
|
21
|
-
if (!
|
|
23
|
+
}, [origin, requesterOrigin]);
|
|
24
|
+
if (!displayOrigin) {
|
|
22
25
|
return null;
|
|
23
26
|
}
|
|
24
|
-
return (jsxRuntime.jsx(Chip.Chip, { className: 'app-origin-tile', children: jsxRuntime.jsx(Typography.Typography, { color: 'secondary', variant: 'body_normal', weight: 'regular', children:
|
|
27
|
+
return (jsxRuntime.jsx(Chip.Chip, { className: 'app-origin-tile', children: jsxRuntime.jsx(Typography.Typography, { color: 'secondary', variant: 'body_normal', weight: 'regular', as: 'span', children: displayOrigin }) }));
|
|
25
28
|
};
|
|
26
29
|
|
|
27
30
|
exports.AppOriginTile = AppOriginTile;
|
|
@@ -6,18 +6,21 @@ import { Typography } from '../Typography/Typography.js';
|
|
|
6
6
|
import { Chip } from '../Chip/Chip.js';
|
|
7
7
|
import { getGlobalWalletContext } from '../../shared/utils/functions/getGlobalWalletContext/getGlobalWalletContext.js';
|
|
8
8
|
|
|
9
|
-
const AppOriginTile = () => {
|
|
9
|
+
const AppOriginTile = ({ origin }) => {
|
|
10
10
|
const { requesterOrigin } = getGlobalWalletContext();
|
|
11
|
-
const
|
|
11
|
+
const displayOrigin = useMemo(() => {
|
|
12
|
+
if (origin) {
|
|
13
|
+
return origin;
|
|
14
|
+
}
|
|
12
15
|
if (requesterOrigin) {
|
|
13
16
|
return requesterOrigin;
|
|
14
17
|
}
|
|
15
18
|
return PlatformService.getDisplayOrigin();
|
|
16
|
-
}, [requesterOrigin]);
|
|
17
|
-
if (!
|
|
19
|
+
}, [origin, requesterOrigin]);
|
|
20
|
+
if (!displayOrigin) {
|
|
18
21
|
return null;
|
|
19
22
|
}
|
|
20
|
-
return (jsx(Chip, { className: 'app-origin-tile', children: jsx(Typography, { color: 'secondary', variant: 'body_normal', weight: 'regular', children:
|
|
23
|
+
return (jsx(Chip, { className: 'app-origin-tile', children: jsx(Typography, { color: 'secondary', variant: 'body_normal', weight: 'regular', as: 'span', children: displayOrigin }) }));
|
|
21
24
|
};
|
|
22
25
|
|
|
23
26
|
export { AppOriginTile };
|
|
@@ -7,8 +7,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
var Typography = require('../Typography/Typography.cjs');
|
|
8
8
|
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}), children: [Boolean(icon) && jsxRuntime.jsx("div", { className: 'chip--icon', children: icon }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', children: children })] }));
|
|
10
|
+
/** An outlined chip component that displays a label and optional leading and trailing icons. */
|
|
11
|
+
const Chip = ({ children, leading, trailing, className, }) => (jsxRuntime.jsxs("div", { className: classNames.classNames('chip', className), children: [Boolean(leading) && jsxRuntime.jsx("div", { className: 'chip--leading', children: leading }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', children: children }), Boolean(trailing) && jsxRuntime.jsx("div", { className: 'chip--trailing', children: trailing })] }));
|
|
13
12
|
|
|
14
13
|
exports.Chip = Chip;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FC, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
export interface ChipProps {
|
|
3
3
|
className?: string;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
leading?: ReactNode;
|
|
5
|
+
trailing?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/** An outlined chip component that displays a label and optional leading and trailing icons. */
|
|
6
8
|
export declare const Chip: FC<PropsWithChildren<ChipProps>>;
|
|
7
|
-
export {};
|
|
@@ -3,8 +3,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { Typography } from '../Typography/Typography.js';
|
|
4
4
|
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}), children: [Boolean(icon) && jsx("div", { className: 'chip--icon', children: icon }), jsx(Typography, { variant: 'body_small', children: children })] }));
|
|
6
|
+
/** An outlined chip component that displays a label and optional leading and trailing icons. */
|
|
7
|
+
const Chip = ({ children, leading, trailing, className, }) => (jsxs("div", { className: classNames('chip', className), children: [Boolean(leading) && jsx("div", { className: 'chip--leading', children: leading }), jsx(Typography, { variant: 'body_small', children: children }), Boolean(trailing) && jsx("div", { className: 'chip--trailing', children: trailing })] }));
|
|
9
8
|
|
|
10
9
|
export { Chip };
|
|
@@ -103,7 +103,7 @@ var useInternalDynamicContext = require('../../context/DynamicContext/useDynamic
|
|
|
103
103
|
|
|
104
104
|
const NeedHelpSection = ({ isRecoveryFlow = false, isExport = false, }) => {
|
|
105
105
|
var _a, _b, _c, _d, _e;
|
|
106
|
-
const { projectSettings, user } = useInternalDynamicContext.useInternalDynamicContext();
|
|
106
|
+
const { projectSettings, user, primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
107
107
|
const { t } = reactI18next.useTranslation();
|
|
108
108
|
const { pushView } = ViewContext.useViewContext();
|
|
109
109
|
const { initPasskeyRecoveryProcess } = usePasskeyRecovery.usePasskeyRecovery();
|
|
@@ -114,8 +114,9 @@ const NeedHelpSection = ({ isRecoveryFlow = false, isExport = false, }) => {
|
|
|
114
114
|
((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) === null || _c === void 0 ? void 0 : _c.find((p) => p.provider === sdkApiCore.ProviderEnum.Turnkey && p.enabledAt)) &&
|
|
115
115
|
Boolean((_e = (_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _d === void 0 ? void 0 : _d.embeddedWallets) === null || _e === void 0 ? void 0 : _e.emailRecoveryEnabled);
|
|
116
116
|
const v2Wallet = user === null || user === void 0 ? void 0 : user.verifiedCredentials.some((credential) => { var _a; return ((_a = credential.walletProperties) === null || _a === void 0 ? void 0 : _a.version) === sdkApiCore.EmbeddedWalletVersionEnum.V2; });
|
|
117
|
+
const v3Wallet = (primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.key) === 'dynamicwaas';
|
|
117
118
|
// revert to v2 wallet view (no passkey recovery) if passkey recovery is not enabled
|
|
118
|
-
const v1Wallet = !v2Wallet && isRecoveryEnabled;
|
|
119
|
+
const v1Wallet = !v3Wallet && !v2Wallet && isRecoveryEnabled;
|
|
119
120
|
const hasContactInfo = Boolean(supportEmail || Object.keys(supportUrls || {}).length > 0);
|
|
120
121
|
const getSupportHelpSession = () => {
|
|
121
122
|
// For v1 wallets, only show the "Go here for support" link that triggers recovery
|
|
@@ -99,7 +99,7 @@ import { useInternalDynamicContext } from '../../context/DynamicContext/useDynam
|
|
|
99
99
|
|
|
100
100
|
const NeedHelpSection = ({ isRecoveryFlow = false, isExport = false, }) => {
|
|
101
101
|
var _a, _b, _c, _d, _e;
|
|
102
|
-
const { projectSettings, user } = useInternalDynamicContext();
|
|
102
|
+
const { projectSettings, user, primaryWallet } = useInternalDynamicContext();
|
|
103
103
|
const { t } = useTranslation();
|
|
104
104
|
const { pushView } = useViewContext();
|
|
105
105
|
const { initPasskeyRecoveryProcess } = usePasskeyRecovery();
|
|
@@ -110,8 +110,9 @@ const NeedHelpSection = ({ isRecoveryFlow = false, isExport = false, }) => {
|
|
|
110
110
|
((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) === null || _c === void 0 ? void 0 : _c.find((p) => p.provider === ProviderEnum.Turnkey && p.enabledAt)) &&
|
|
111
111
|
Boolean((_e = (_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _d === void 0 ? void 0 : _d.embeddedWallets) === null || _e === void 0 ? void 0 : _e.emailRecoveryEnabled);
|
|
112
112
|
const v2Wallet = user === null || user === void 0 ? void 0 : user.verifiedCredentials.some((credential) => { var _a; return ((_a = credential.walletProperties) === null || _a === void 0 ? void 0 : _a.version) === EmbeddedWalletVersionEnum.V2; });
|
|
113
|
+
const v3Wallet = (primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.key) === 'dynamicwaas';
|
|
113
114
|
// revert to v2 wallet view (no passkey recovery) if passkey recovery is not enabled
|
|
114
|
-
const v1Wallet = !v2Wallet && isRecoveryEnabled;
|
|
115
|
+
const v1Wallet = !v3Wallet && !v2Wallet && isRecoveryEnabled;
|
|
115
116
|
const hasContactInfo = Boolean(supportEmail || Object.keys(supportUrls || {}).length > 0);
|
|
116
117
|
const getSupportHelpSession = () => {
|
|
117
118
|
// For v1 wallets, only show the "Go here for support" link that triggers recovery
|
|
@@ -14,6 +14,7 @@ var walletBook = require('@dynamic-labs/wallet-book');
|
|
|
14
14
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
15
15
|
var version = require('../../../version.cjs');
|
|
16
16
|
var app = require('../../app.cjs');
|
|
17
|
+
var useInitializeSdkClient = require('../../client/extension/useInitializeSdkClient/useInitializeSdkClient.cjs');
|
|
17
18
|
require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
18
19
|
var ViewContext = require('../ViewContext/ViewContext.cjs');
|
|
19
20
|
require('@dynamic-labs/sdk-api-core');
|
|
@@ -729,6 +730,8 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
729
730
|
};
|
|
730
731
|
/** The context provider you need to have access too all of Dynamic's hooks */
|
|
731
732
|
const DynamicContextProvider = (props) => {
|
|
733
|
+
// Initialize client before anything else
|
|
734
|
+
useInitializeSdkClient.useInitializeSdkClient(props);
|
|
732
735
|
logger.Logger.setEnvironmentId(props.settings.environmentId);
|
|
733
736
|
logger.Logger.setEmitErrors(props.emitErrors);
|
|
734
737
|
useParentDynamicContextGuard.useParentDynamicContextGuard();
|
|
@@ -10,6 +10,7 @@ import { useWalletBookCdn, getWalletBookCdnUrl, WalletBookContextProvider } from
|
|
|
10
10
|
import { setChainInfoOverrides, logger as logger$1, isSessionKeyCompatibleWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
11
11
|
import { VERSION } from '../../../version.js';
|
|
12
12
|
import { DynamicAuthFlow } from '../../app.js';
|
|
13
|
+
import { useInitializeSdkClient } from '../../client/extension/useInitializeSdkClient/useInitializeSdkClient.js';
|
|
13
14
|
import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
14
15
|
import { ViewContextProvider } from '../ViewContext/ViewContext.js';
|
|
15
16
|
import '@dynamic-labs/sdk-api-core';
|
|
@@ -725,6 +726,8 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
725
726
|
};
|
|
726
727
|
/** The context provider you need to have access too all of Dynamic's hooks */
|
|
727
728
|
const DynamicContextProvider = (props) => {
|
|
729
|
+
// Initialize client before anything else
|
|
730
|
+
useInitializeSdkClient(props);
|
|
728
731
|
Logger.setEnvironmentId(props.settings.environmentId);
|
|
729
732
|
Logger.setEmitErrors(props.emitErrors);
|
|
730
733
|
useParentDynamicContextGuard();
|
package/src/lib/context/OnrampContext/useEnabledOnrampProviders/useEnabledOnrampProviders.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Wallet } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
-
import { type
|
|
2
|
+
import { type RampConfiguration, type OnrampProviders } from '@dynamic-labs/sdk-api-core';
|
|
3
3
|
export type EnabledOnrampProvidersTarget = {
|
|
4
4
|
address?: string;
|
|
5
5
|
token?: string;
|
|
@@ -11,5 +11,5 @@ type UseEnabledOnrampProvidersProps = {
|
|
|
11
11
|
environmentId: string;
|
|
12
12
|
target: EnabledOnrampProvidersTarget;
|
|
13
13
|
};
|
|
14
|
-
export declare const useEnabledOnrampProviders: ({ primaryWallet, network, environmentId, projectSettingsOnramps, target, }: UseEnabledOnrampProvidersProps) =>
|
|
14
|
+
export declare const useEnabledOnrampProviders: ({ primaryWallet, network, environmentId, projectSettingsOnramps, target, }: UseEnabledOnrampProvidersProps) => RampConfiguration[];
|
|
15
15
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps, FC } from 'react';
|
|
2
2
|
import { viewToComponentMap } from '../../../views/viewToComponentMap';
|
|
3
|
-
export type ViewType = 'access-blocked' | 'select-hardware-wallet' | 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-no-wallet' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-wallet-only' | 'login-with-email-verification' | 'login-with-sms-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | 'verify-email' | 'verify-sms' | 'wallet-connect-mobile-wallets-list' | 'wallet-list' | 'external-funding-wallet-list' | 'sandbox-maximum-threshold-reached' | 'multi-wallet-wallet-list' | 'wallet-sign' | 'wallet-used' | 'wallet-group' | 'select-wallet-in-wallet-group' | 'wait-for-email-confirmation-view' | 'email-wallet-otp-verification-view' | 'social-redirect-view' | 'wallet-locked-view' | 'social-wrong-account' | 'gate-blocked-wallet' | 'bridge-welcome' | 'bridge-summary' | 'bridge-next-wallet-connection' | 'account-exists' | 'merge-user-accounts' | 'merge-user-accounts-conflicts' | 'merge-user-accounts-with-same-email' | 'mfa-choose-device' | 'mfa-recovery' | 'mfa-secure-device' | 'mfa-secure-device-help' | 'mfa-verification' | 'mfa-display-backup-codes' | 'wallet-cannot-be-transferred' | 'passkey-intro' | 'passkey-recovery-add-email' | 'global-wallet-confirm' | 'global-wallet-malicious' | 'global-wallet-info' | 'passkey-recovery-start' | 'passkey-recovery-bundle' | 'passkey-recovery-complete' | 'passkey-new-domain-detected' | 'embedded-delete-view' | 'embedded-reveal-view' | 'embedded-reveal-account-view' | 'embedded-wallet-auth-choice' | 'rename-passkey' | 'wallet-redirect-view' | 'mobile-wallet-redirect-view' | 'farcaster-connect-view' | 'embedded-wallet-exists' | 'user-delete-account';
|
|
3
|
+
export type ViewType = 'access-blocked' | 'backup-unsuccessful' | 'select-hardware-wallet' | 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-no-wallet' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-wallet-only' | 'login-with-email-verification' | 'login-with-sms-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | 'verify-email' | 'verify-sms' | 'wallet-connect-mobile-wallets-list' | 'wallet-list' | 'external-funding-wallet-list' | 'sandbox-maximum-threshold-reached' | 'multi-wallet-wallet-list' | 'wallet-sign' | 'wallet-used' | 'wallet-group' | 'select-wallet-in-wallet-group' | 'wait-for-email-confirmation-view' | 'email-wallet-otp-verification-view' | 'social-redirect-view' | 'wallet-locked-view' | 'social-wrong-account' | 'gate-blocked-wallet' | 'bridge-welcome' | 'bridge-summary' | 'bridge-next-wallet-connection' | 'account-exists' | 'merge-user-accounts' | 'merge-user-accounts-conflicts' | 'merge-user-accounts-with-same-email' | 'mfa-choose-device' | 'mfa-recovery' | 'mfa-secure-device' | 'mfa-secure-device-help' | 'mfa-verification' | 'mfa-display-backup-codes' | 'wallet-cannot-be-transferred' | 'passkey-intro' | 'passkey-recovery-add-email' | 'global-wallet-confirm' | 'global-wallet-malicious' | 'global-wallet-info' | 'passkey-recovery-start' | 'passkey-recovery-bundle' | 'passkey-recovery-complete' | 'passkey-new-domain-detected' | 'embedded-delete-view' | 'embedded-reveal-view' | 'embedded-reveal-account-view' | 'embedded-wallet-auth-choice' | 'rename-passkey' | 'wallet-redirect-view' | 'mobile-wallet-redirect-view' | 'farcaster-connect-view' | 'embedded-wallet-exists' | 'user-delete-account';
|
|
4
4
|
export type ViewMapConstraint = Record<ViewType, FC<any>>;
|
|
5
5
|
export type ViewMap = typeof viewToComponentMap;
|
|
6
6
|
export type ViewState<T extends ViewType> = {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Account, CreateExchangeTransferRequest, ExchangeKeyEnum, ExchangeTransferResponse } from '@dynamic-labs/sdk-api-core';
|
|
2
|
+
/**
|
|
3
|
+
* Retrieve the list of exchange accounts linked to a user for a given exchange provider.
|
|
4
|
+
*
|
|
5
|
+
* @param environmentId – Dynamic environment ID
|
|
6
|
+
* @param exchangeKey – The key identifying the exchange provider (e.g., 'coinbase')
|
|
7
|
+
* @returns An array of `Account` objects representing the user's linked exchange accounts
|
|
8
|
+
*/
|
|
9
|
+
export declare const getUserExchangeAccounts: ({ environmentId, exchangeKey, }: {
|
|
10
|
+
environmentId: string;
|
|
11
|
+
exchangeKey: ExchangeKeyEnum;
|
|
12
|
+
}) => Promise<Account[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Transfer funds from a user-linked exchange account to an external address
|
|
15
|
+
* or another Coinbase account.
|
|
16
|
+
*
|
|
17
|
+
* @param environmentId – Dynamic environment ID
|
|
18
|
+
* @param exchangeKey – The key identifying the exchange provider (e.g., `'coinbase'`)
|
|
19
|
+
* @param accountId – The exchange-account ID to transfer funds **from**
|
|
20
|
+
* @param transfer – JSON body matching `CreateExchangeTransferRequest`
|
|
21
|
+
* @returns Details of the created transfer (`ExchangeTransferResponse`)
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* await createExchangeAccountTransfer({
|
|
26
|
+
* environmentId: 'env_123',
|
|
27
|
+
* exchangeKey: ExchangeKeyEnum.COINBASE,
|
|
28
|
+
* accountId: 'acc_456',
|
|
29
|
+
* transfer: {
|
|
30
|
+
* to: '0xRecipientAddress',
|
|
31
|
+
* amount: 0.25,
|
|
32
|
+
* currency: 'ETH',
|
|
33
|
+
* network: 'ethereum',
|
|
34
|
+
* description: 'Withdrawal to cold wallet',
|
|
35
|
+
* mfaCode: '123456',
|
|
36
|
+
* },
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare const createExchangeAccountTransfer: ({ environmentId, exchangeKey, accountId, transfer, }: {
|
|
41
|
+
environmentId: string;
|
|
42
|
+
exchangeKey: ExchangeKeyEnum;
|
|
43
|
+
accountId: string;
|
|
44
|
+
transfer: CreateExchangeTransferRequest;
|
|
45
|
+
}) => Promise<ExchangeTransferResponse>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './exchangeAccounts';
|