@dynamic-labs/sdk-react-core 4.20.0 → 4.20.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/CHANGELOG.md +12 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +9 -3
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.d.ts +1 -0
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +9 -4
- package/src/lib/widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.d.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.20.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.0...v4.20.1) (2025-06-09)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **global-wallet:** new createKernelClient method to native api ([#8883](https://github.com/dynamic-labs/dynamic-auth/issues/8883)) ([005b34c](https://github.com/dynamic-labs/dynamic-auth/commit/005b34c230ceb5e945547e129231c108a6cec444))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* default embedded wallet chain enum ([#8917](https://github.com/dynamic-labs/dynamic-auth/issues/8917)) ([e9fd715](https://github.com/dynamic-labs/dynamic-auth/commit/e9fd715506598bfabbc71454421885d05a06a3ec))
|
|
13
|
+
|
|
2
14
|
## [4.20.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.19.7...v4.20.0) (2025-06-09)
|
|
3
15
|
|
|
4
16
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.20.
|
|
3
|
+
"version": "4.20.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.681",
|
|
6
6
|
"@dynamic-labs-sdk/client": "0.0.1-alpha.5",
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
"yup": "0.32.11",
|
|
16
16
|
"react-international-phone": "4.2.5",
|
|
17
17
|
"bs58": "5.0.0",
|
|
18
|
-
"@dynamic-labs/assert-package-version": "4.20.
|
|
19
|
-
"@dynamic-labs/iconic": "4.20.
|
|
20
|
-
"@dynamic-labs/logger": "4.20.
|
|
21
|
-
"@dynamic-labs/multi-wallet": "4.20.
|
|
22
|
-
"@dynamic-labs/rpc-providers": "4.20.
|
|
23
|
-
"@dynamic-labs/store": "4.20.
|
|
24
|
-
"@dynamic-labs/types": "4.20.
|
|
25
|
-
"@dynamic-labs/utils": "4.20.
|
|
26
|
-
"@dynamic-labs/wallet-book": "4.20.
|
|
27
|
-
"@dynamic-labs/wallet-connector-core": "4.20.
|
|
18
|
+
"@dynamic-labs/assert-package-version": "4.20.1",
|
|
19
|
+
"@dynamic-labs/iconic": "4.20.1",
|
|
20
|
+
"@dynamic-labs/logger": "4.20.1",
|
|
21
|
+
"@dynamic-labs/multi-wallet": "4.20.1",
|
|
22
|
+
"@dynamic-labs/rpc-providers": "4.20.1",
|
|
23
|
+
"@dynamic-labs/store": "4.20.1",
|
|
24
|
+
"@dynamic-labs/types": "4.20.1",
|
|
25
|
+
"@dynamic-labs/utils": "4.20.1",
|
|
26
|
+
"@dynamic-labs/wallet-book": "4.20.1",
|
|
27
|
+
"@dynamic-labs/wallet-connector-core": "4.20.1",
|
|
28
28
|
"eventemitter3": "5.0.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
@@ -102,6 +102,13 @@ require('../../../store/state/tokenBalances.cjs');
|
|
|
102
102
|
require('../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
103
103
|
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
104
104
|
|
|
105
|
+
const getEmbeddedChain = (chainName) => {
|
|
106
|
+
if (chainName === 'SOL')
|
|
107
|
+
return sdkApiCore.EmbeddedWalletChainEnum.Sol;
|
|
108
|
+
if (chainName === 'BTC')
|
|
109
|
+
return sdkApiCore.EmbeddedWalletChainEnum.Btc;
|
|
110
|
+
return sdkApiCore.EmbeddedWalletChainEnum.Evm;
|
|
111
|
+
};
|
|
105
112
|
// This hook needs to be async that's why it's not using useMutation
|
|
106
113
|
const useCreateDynamicEmbeddedWalletMutation = () => {
|
|
107
114
|
var _a, _b;
|
|
@@ -116,9 +123,7 @@ const useCreateDynamicEmbeddedWalletMutation = () => {
|
|
|
116
123
|
const primaryEmbeddedChain = findPrimaryEmbeddedChain.findPrimaryEmbeddedChain(projectSettings);
|
|
117
124
|
const embeddedChains = embeddedChainConfig
|
|
118
125
|
.filter((chain) => chain.enabled)
|
|
119
|
-
.map((c) => c.name
|
|
120
|
-
? sdkApiCore.EmbeddedWalletChainEnum.Sol
|
|
121
|
-
: sdkApiCore.EmbeddedWalletChainEnum.Evm);
|
|
126
|
+
.map((c) => getEmbeddedChain(c.name));
|
|
122
127
|
const createDynamicEmbeddedWalletMutation = React.useCallback((_c) => _tslib.__awaiter(void 0, [_c], void 0, function* ({ environmentId, walletConnectorOptions, withAuthenticator, options, chains, }) {
|
|
123
128
|
var _d, _e;
|
|
124
129
|
setIsLoading(true);
|
|
@@ -190,4 +195,5 @@ const useCreateDynamicEmbeddedWalletMutation = () => {
|
|
|
190
195
|
};
|
|
191
196
|
};
|
|
192
197
|
|
|
198
|
+
exports.getEmbeddedChain = getEmbeddedChain;
|
|
193
199
|
exports.useCreateDynamicEmbeddedWalletMutation = useCreateDynamicEmbeddedWalletMutation;
|
|
@@ -10,6 +10,7 @@ type MutationProps = {
|
|
|
10
10
|
};
|
|
11
11
|
chains?: EmbeddedWalletChainEnum[];
|
|
12
12
|
};
|
|
13
|
+
export declare const getEmbeddedChain: (chainName: string) => EmbeddedWalletChainEnum.Evm | EmbeddedWalletChainEnum.Sol | EmbeddedWalletChainEnum.Btc;
|
|
13
14
|
export declare const useCreateDynamicEmbeddedWalletMutation: () => {
|
|
14
15
|
createDynamicEmbeddedWalletMutation: ({ environmentId, walletConnectorOptions, withAuthenticator, options, chains, }: MutationProps) => Promise<void>;
|
|
15
16
|
error: unknown;
|
|
@@ -98,6 +98,13 @@ import '../../../store/state/tokenBalances.js';
|
|
|
98
98
|
import '../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
99
99
|
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
100
100
|
|
|
101
|
+
const getEmbeddedChain = (chainName) => {
|
|
102
|
+
if (chainName === 'SOL')
|
|
103
|
+
return EmbeddedWalletChainEnum.Sol;
|
|
104
|
+
if (chainName === 'BTC')
|
|
105
|
+
return EmbeddedWalletChainEnum.Btc;
|
|
106
|
+
return EmbeddedWalletChainEnum.Evm;
|
|
107
|
+
};
|
|
101
108
|
// This hook needs to be async that's why it's not using useMutation
|
|
102
109
|
const useCreateDynamicEmbeddedWalletMutation = () => {
|
|
103
110
|
var _a, _b;
|
|
@@ -112,9 +119,7 @@ const useCreateDynamicEmbeddedWalletMutation = () => {
|
|
|
112
119
|
const primaryEmbeddedChain = findPrimaryEmbeddedChain(projectSettings);
|
|
113
120
|
const embeddedChains = embeddedChainConfig
|
|
114
121
|
.filter((chain) => chain.enabled)
|
|
115
|
-
.map((c) => c.name
|
|
116
|
-
? EmbeddedWalletChainEnum.Sol
|
|
117
|
-
: EmbeddedWalletChainEnum.Evm);
|
|
122
|
+
.map((c) => getEmbeddedChain(c.name));
|
|
118
123
|
const createDynamicEmbeddedWalletMutation = useCallback((_c) => __awaiter(void 0, [_c], void 0, function* ({ environmentId, walletConnectorOptions, withAuthenticator, options, chains, }) {
|
|
119
124
|
var _d, _e;
|
|
120
125
|
setIsLoading(true);
|
|
@@ -186,4 +191,4 @@ const useCreateDynamicEmbeddedWalletMutation = () => {
|
|
|
186
191
|
};
|
|
187
192
|
};
|
|
188
193
|
|
|
189
|
-
export { useCreateDynamicEmbeddedWalletMutation };
|
|
194
|
+
export { getEmbeddedChain, useCreateDynamicEmbeddedWalletMutation };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ExchangeKeyEnum, ProviderEnum } from '@dynamic-labs/sdk-api-core';
|
|
2
|
+
export declare const convertExchangeKeytoProviderEnum: (exchangeKey: ExchangeKeyEnum) => ProviderEnum;
|
|
3
|
+
export declare const convertProviderToExchangeKeyEnum: (provider: ProviderEnum) => ExchangeKeyEnum;
|
|
4
|
+
export declare const isProviderExchange: (provider: ProviderEnum) => boolean;
|