@dynamic-labs/sdk-react-core 4.9.1 → 4.9.2-preview.0
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 +2 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/index.cjs +2 -0
- package/src/index.d.ts +4 -3
- package/src/index.js +1 -0
- package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.cjs +8 -2
- package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.js +9 -3
package/CHANGELOG.md
CHANGED
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.9.
|
|
3
|
+
"version": "4.9.2-preview.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.638",
|
|
6
6
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
"yup": "0.32.11",
|
|
15
15
|
"react-international-phone": "4.2.5",
|
|
16
16
|
"bs58": "5.0.0",
|
|
17
|
-
"@dynamic-labs/assert-package-version": "4.9.
|
|
18
|
-
"@dynamic-labs/iconic": "4.9.
|
|
19
|
-
"@dynamic-labs/logger": "4.9.
|
|
20
|
-
"@dynamic-labs/multi-wallet": "4.9.
|
|
21
|
-
"@dynamic-labs/rpc-providers": "4.9.
|
|
22
|
-
"@dynamic-labs/store": "4.9.
|
|
23
|
-
"@dynamic-labs/types": "4.9.
|
|
24
|
-
"@dynamic-labs/utils": "4.9.
|
|
25
|
-
"@dynamic-labs/wallet-book": "4.9.
|
|
26
|
-
"@dynamic-labs/wallet-connector-core": "4.9.
|
|
17
|
+
"@dynamic-labs/assert-package-version": "4.9.2-preview.0",
|
|
18
|
+
"@dynamic-labs/iconic": "4.9.2-preview.0",
|
|
19
|
+
"@dynamic-labs/logger": "4.9.2-preview.0",
|
|
20
|
+
"@dynamic-labs/multi-wallet": "4.9.2-preview.0",
|
|
21
|
+
"@dynamic-labs/rpc-providers": "4.9.2-preview.0",
|
|
22
|
+
"@dynamic-labs/store": "4.9.2-preview.0",
|
|
23
|
+
"@dynamic-labs/types": "4.9.2-preview.0",
|
|
24
|
+
"@dynamic-labs/utils": "4.9.2-preview.0",
|
|
25
|
+
"@dynamic-labs/wallet-book": "4.9.2-preview.0",
|
|
26
|
+
"@dynamic-labs/wallet-connector-core": "4.9.2-preview.0",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
package/src/index.cjs
CHANGED
|
@@ -177,6 +177,7 @@ var getNetwork = require('./lib/utils/functions/getNetwork/getNetwork.cjs');
|
|
|
177
177
|
var useFunding = require('./lib/utils/hooks/useFunding/useFunding.cjs');
|
|
178
178
|
var useOnramp = require('./lib/utils/hooks/useOnramp/useOnramp.cjs');
|
|
179
179
|
var useOpenFundingOptions = require('./lib/utils/hooks/useOpenFundingOptions/useOpenFundingOptions.cjs');
|
|
180
|
+
var coinbase = require('./lib/utils/functions/onrampProviders/coinbase.cjs');
|
|
180
181
|
var SendBalanceContext = require('./lib/context/SendBalanceContext/SendBalanceContext.cjs');
|
|
181
182
|
require('./lib/context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
182
183
|
require('./lib/context/ConnectWithOtpContext/constants.cjs');
|
|
@@ -305,6 +306,7 @@ exports.getNetwork = getNetwork.getNetwork;
|
|
|
305
306
|
exports.useFunding = useFunding.useFunding;
|
|
306
307
|
exports.useOnramp = useOnramp.useOnramp;
|
|
307
308
|
exports.useOpenFundingOptions = useOpenFundingOptions.useOpenFundingOptions;
|
|
309
|
+
exports.formatCoinbaseOnrampUrl = coinbase.formatCoinbaseOnrampUrl;
|
|
308
310
|
exports.useSendBalance = SendBalanceContext.useSendBalance;
|
|
309
311
|
exports.useConnectWithOtp = useConnectWithOtp.useConnectWithOtp;
|
|
310
312
|
exports.useSwitchNetwork = useSwitchNetwork.useSwitchNetwork;
|
package/src/index.d.ts
CHANGED
|
@@ -92,9 +92,9 @@ export {
|
|
|
92
92
|
MockContextProvider, } from './lib/context/MockContext';
|
|
93
93
|
export { getDefaultColor, getThemeConfig, themesData, } from './lib/context/ThemeContext/themesData';
|
|
94
94
|
/** @deprecated */
|
|
95
|
-
export {
|
|
95
|
+
export type {
|
|
96
96
|
/** @deprecated */
|
|
97
|
-
|
|
97
|
+
ViewType, } from './lib/context/ViewContext';
|
|
98
98
|
export type { NotSupportedError, SandboxMaximumThresholdReachedError, NoAccessError, ChainalysisError, EmailAlreadyExistsError, UsernameAlreadyExistsError, SocialAccountAlreadyExistsError, WalletNotDeployedError, WalletUsedError, EmailVerificationError, AccountExistsError, InvalidPhoneNumberError, } from '@dynamic-labs/utils';
|
|
99
99
|
export type { WalletConnector, Chain, } from '@dynamic-labs/wallet-connector-core';
|
|
100
100
|
export type { EvmNetwork, PhoneData, OtpDestination, UserProfile,
|
|
@@ -103,7 +103,7 @@ AuthOptions as AuthOption, AuthOptions,
|
|
|
103
103
|
/** @deprecated use AuthMethod instead */
|
|
104
104
|
AuthMethod as AuthType, AuthMethod, } from '@dynamic-labs/types';
|
|
105
105
|
export { publicDynamicEvents as dynamicEvents } from './lib/events/dynamicEvents';
|
|
106
|
-
export {
|
|
106
|
+
export type { UserWalletsChangedParams } from './lib/events';
|
|
107
107
|
export { mergeNetworks } from './lib/utils/functions/mergeNetworks';
|
|
108
108
|
export { overrideNetworkRpcUrl } from './lib/utils/functions/overrideNetworkRpcUrl';
|
|
109
109
|
export {
|
|
@@ -121,6 +121,7 @@ useFunding, } from './lib/utils/hooks/useFunding';
|
|
|
121
121
|
export { useOnramp } from './lib/utils/hooks/useOnramp';
|
|
122
122
|
export { useOpenFundingOptions } from './lib/utils/hooks/useOpenFundingOptions';
|
|
123
123
|
export { useFundWithWallet } from './lib/utils/hooks/useFundWithWallet';
|
|
124
|
+
export { formatCoinbaseOnrampUrl } from './lib/utils/functions/onrampProviders';
|
|
124
125
|
export { useUserUpdateRequest, useWalletConnectorEvent, } from './lib/utils/hooks';
|
|
125
126
|
export { type VerifyOtp, useOtpVerificationRequest, } from './lib/utils/hooks/authenticationHooks/';
|
|
126
127
|
export type { UpdateUserFieldsArg } from './lib/utils/hooks/';
|
package/src/index.js
CHANGED
|
@@ -173,6 +173,7 @@ export { getNetwork } from './lib/utils/functions/getNetwork/getNetwork.js';
|
|
|
173
173
|
export { useFunding } from './lib/utils/hooks/useFunding/useFunding.js';
|
|
174
174
|
export { useOnramp } from './lib/utils/hooks/useOnramp/useOnramp.js';
|
|
175
175
|
export { useOpenFundingOptions } from './lib/utils/hooks/useOpenFundingOptions/useOpenFundingOptions.js';
|
|
176
|
+
export { formatCoinbaseOnrampUrl } from './lib/utils/functions/onrampProviders/coinbase.js';
|
|
176
177
|
export { useSendBalance } from './lib/context/SendBalanceContext/SendBalanceContext.js';
|
|
177
178
|
import './lib/context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
178
179
|
import './lib/context/ConnectWithOtpContext/constants.js';
|
package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.cjs
CHANGED
|
@@ -210,7 +210,12 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
210
210
|
const handleWalletItemClick = (wallet) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
211
211
|
const { walletConnector, isInstalledOnBrowser } = wallet;
|
|
212
212
|
const shouldEndWalletConnectorSession = walletConnector.connectedChain === 'FLOW' ||
|
|
213
|
-
walletConnectorCore.isPhantomRedirectConnector(walletConnector)
|
|
213
|
+
walletConnectorCore.isPhantomRedirectConnector(walletConnector) ||
|
|
214
|
+
// because WC only supports one connection at a time,
|
|
215
|
+
// we need to end the session (disconnect) when the user selects
|
|
216
|
+
// a different wallet to connect with
|
|
217
|
+
// a new connection is established a few steps further down
|
|
218
|
+
walletConnectorCore.isWalletConnectConnector(walletConnector);
|
|
214
219
|
logger.logger.logVerboseTroubleshootingMessage('[handleWalletItemClick]', {
|
|
215
220
|
mockedSDK,
|
|
216
221
|
shouldEndWalletConnectorSession,
|
|
@@ -241,7 +246,8 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
241
246
|
}
|
|
242
247
|
if (!allowAlreadyConnectedWallet &&
|
|
243
248
|
isSelectedWalletAlreadyConnected.isSelectedWalletAlreadyConnected(linkedWallets, walletConnector, user) &&
|
|
244
|
-
walletConnector.connectedChain !== 'FLOW'
|
|
249
|
+
walletConnector.connectedChain !== 'FLOW' &&
|
|
250
|
+
!walletConnector.isWalletConnect) {
|
|
245
251
|
// wallet is already connected
|
|
246
252
|
handleAlreadyConnectedWallet(walletConnector);
|
|
247
253
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { StorageService, isMobile, UserRejectedRequestError } from '@dynamic-labs/utils';
|
|
4
|
-
import { isPhantomRedirectConnector } from '@dynamic-labs/wallet-connector-core';
|
|
4
|
+
import { isPhantomRedirectConnector, isWalletConnectConnector } from '@dynamic-labs/wallet-connector-core';
|
|
5
5
|
import 'react';
|
|
6
6
|
import '../../../../context/DynamicContext/DynamicContext.js';
|
|
7
7
|
import '@dynamic-labs/sdk-api-core';
|
|
@@ -206,7 +206,12 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
206
206
|
const handleWalletItemClick = (wallet) => __awaiter(void 0, void 0, void 0, function* () {
|
|
207
207
|
const { walletConnector, isInstalledOnBrowser } = wallet;
|
|
208
208
|
const shouldEndWalletConnectorSession = walletConnector.connectedChain === 'FLOW' ||
|
|
209
|
-
isPhantomRedirectConnector(walletConnector)
|
|
209
|
+
isPhantomRedirectConnector(walletConnector) ||
|
|
210
|
+
// because WC only supports one connection at a time,
|
|
211
|
+
// we need to end the session (disconnect) when the user selects
|
|
212
|
+
// a different wallet to connect with
|
|
213
|
+
// a new connection is established a few steps further down
|
|
214
|
+
isWalletConnectConnector(walletConnector);
|
|
210
215
|
logger.logVerboseTroubleshootingMessage('[handleWalletItemClick]', {
|
|
211
216
|
mockedSDK,
|
|
212
217
|
shouldEndWalletConnectorSession,
|
|
@@ -237,7 +242,8 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
237
242
|
}
|
|
238
243
|
if (!allowAlreadyConnectedWallet &&
|
|
239
244
|
isSelectedWalletAlreadyConnected(linkedWallets, walletConnector, user) &&
|
|
240
|
-
walletConnector.connectedChain !== 'FLOW'
|
|
245
|
+
walletConnector.connectedChain !== 'FLOW' &&
|
|
246
|
+
!walletConnector.isWalletConnect) {
|
|
241
247
|
// wallet is already connected
|
|
242
248
|
handleAlreadyConnectedWallet(walletConnector);
|
|
243
249
|
}
|