@dynamic-labs/sdk-react-core 2.1.0-alpha.16 → 2.1.0-alpha.17

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 CHANGED
@@ -1,4 +1,11 @@
1
1
 
2
+ ## [2.1.0-alpha.17](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.16...v2.1.0-alpha.17) (2024-05-15)
3
+
4
+
5
+ ### Features
6
+
7
+ * add coinbaseWalletPreference prop ([#5607](https://github.com/dynamic-labs/DynamicAuth/issues/5607)) ([1ac3b2c](https://github.com/dynamic-labs/DynamicAuth/commit/1ac3b2ce7abb136465f4aa88b045dfb70d99aad7))
8
+
2
9
  ## [2.1.0-alpha.16](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.15...v2.1.0-alpha.16) (2024-05-14)
3
10
 
4
11
 
package/package.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "2.1.0-alpha.16";
6
+ var version = "2.1.0-alpha.17";
7
7
  var dependencies = {
8
8
  "@dynamic-labs/sdk-api-core": "0.0.433",
9
9
  "@hcaptcha/react-hcaptcha": "1.4.4",
package/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client'
2
- var version = "2.1.0-alpha.16";
2
+ var version = "2.1.0-alpha.17";
3
3
  var dependencies = {
4
4
  "@dynamic-labs/sdk-api-core": "0.0.433",
5
5
  "@hcaptcha/react-hcaptcha": "1.4.4",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "2.1.0-alpha.16",
3
+ "version": "2.1.0-alpha.17",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -18,17 +18,17 @@
18
18
  "yup": "0.32.11",
19
19
  "react-international-phone": "4.2.5",
20
20
  "zustand": "4.5.2",
21
- "@dynamic-labs/iconic": "2.1.0-alpha.16",
22
- "@dynamic-labs/logger": "2.1.0-alpha.16",
23
- "@dynamic-labs/multi-wallet": "2.1.0-alpha.16",
24
- "@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.16",
25
- "@dynamic-labs/rpc-provider-solana": "2.1.0-alpha.16",
26
- "@dynamic-labs/rpc-providers": "2.1.0-alpha.16",
27
- "@dynamic-labs/types": "2.1.0-alpha.16",
28
- "@dynamic-labs/utils": "2.1.0-alpha.16",
29
- "@dynamic-labs/viem-utils": "2.1.0-alpha.16",
30
- "@dynamic-labs/wallet-book": "2.1.0-alpha.16",
31
- "@dynamic-labs/wallet-connector-core": "2.1.0-alpha.16",
21
+ "@dynamic-labs/iconic": "2.1.0-alpha.17",
22
+ "@dynamic-labs/logger": "2.1.0-alpha.17",
23
+ "@dynamic-labs/multi-wallet": "2.1.0-alpha.17",
24
+ "@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.17",
25
+ "@dynamic-labs/rpc-provider-solana": "2.1.0-alpha.17",
26
+ "@dynamic-labs/rpc-providers": "2.1.0-alpha.17",
27
+ "@dynamic-labs/types": "2.1.0-alpha.17",
28
+ "@dynamic-labs/utils": "2.1.0-alpha.17",
29
+ "@dynamic-labs/viem-utils": "2.1.0-alpha.17",
30
+ "@dynamic-labs/wallet-book": "2.1.0-alpha.17",
31
+ "@dynamic-labs/wallet-connector-core": "2.1.0-alpha.17",
32
32
  "eventemitter3": "5.0.1"
33
33
  },
34
34
  "devDependencies": {
@@ -135,7 +135,7 @@ const DynamicContext = React.createContext(undefined);
135
135
  /** The context provider itself we only use internally */
136
136
  const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, locale: locale$1, }) => {
137
137
  var _a, _b, _c, _d, _e, _f, _g;
138
- const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, enableConnectOnlyFallback = false, deepLinkPreference: deepLinkPreferenceProp = 'native', bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = values.DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displaySiweStatement = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, walletsFilter, logLevel = 'WARN', mobileExperience = 'in-app-browser', notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = false, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, hideEmbeddedWalletTransactionUIs, handlers, } = settings$1;
138
+ const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, coinbaseWalletPreference, enableConnectOnlyFallback = false, deepLinkPreference: deepLinkPreferenceProp = 'native', bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = values.DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displaySiweStatement = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, walletsFilter, logLevel = 'WARN', mobileExperience = 'in-app-browser', notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = false, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, hideEmbeddedWalletTransactionUIs, handlers, } = settings$1;
139
139
  localStorage.LocalStorage.setSuffix(settings$1.localStorageSuffix);
140
140
  /**
141
141
  * initialize global store
@@ -224,6 +224,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
224
224
  const { walletConnectorOptions } = useWalletConnectorOptions.useWalletConnectorOptions({
225
225
  appLogoUrl,
226
226
  appName,
227
+ coinbaseWalletPreference,
227
228
  deepLinkPreference,
228
229
  flowNetwork,
229
230
  mobileExperience,
@@ -1,6 +1,6 @@
1
1
  import { FC, ReactNode } from 'react';
2
2
  import { LogLevel } from '@dynamic-labs/logger';
3
- import { SocialProviderFilter } from '@dynamic-labs/types';
3
+ import { type CoinbaseWalletPreference, type SocialProviderFilter } from '@dynamic-labs/types';
4
4
  import { DeepLinkVariant, WalletConnectorExtension, WalletConnectorsMethod } from '@dynamic-labs/wallet-connector-core';
5
5
  import { LocaleResource } from '../../locale';
6
6
  import { AccessDeniedCustomButton, AuthModeType, ChainToWalletMap, DynamicEventsCallbacks, RecommendedWallet, WalletOption } from '../../shared';
@@ -20,6 +20,7 @@ export interface DynamicContextProps {
20
20
  appLogoUrl?: string;
21
21
  appName?: string;
22
22
  bridgeChains?: ChainsToConnect[];
23
+ coinbaseWalletPreference?: CoinbaseWalletPreference;
23
24
  cssOverrides?: string | JSX.Element;
24
25
  customPrivacyPolicy?: ReactNode;
25
26
  customTermsOfServices?: ReactNode;
@@ -131,7 +131,7 @@ const DynamicContext = createContext(undefined);
131
131
  /** The context provider itself we only use internally */
132
132
  const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) => {
133
133
  var _a, _b, _c, _d, _e, _f, _g;
134
- const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, enableConnectOnlyFallback = false, deepLinkPreference: deepLinkPreferenceProp = 'native', bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displaySiweStatement = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, walletsFilter, logLevel = 'WARN', mobileExperience = 'in-app-browser', notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = false, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, hideEmbeddedWalletTransactionUIs, handlers, } = settings;
134
+ const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, coinbaseWalletPreference, enableConnectOnlyFallback = false, deepLinkPreference: deepLinkPreferenceProp = 'native', bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displaySiweStatement = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, walletsFilter, logLevel = 'WARN', mobileExperience = 'in-app-browser', notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = false, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, hideEmbeddedWalletTransactionUIs, handlers, } = settings;
135
135
  LocalStorage.setSuffix(settings.localStorageSuffix);
136
136
  /**
137
137
  * initialize global store
@@ -220,6 +220,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) =>
220
220
  const { walletConnectorOptions } = useWalletConnectorOptions({
221
221
  appLogoUrl,
222
222
  appName,
223
+ coinbaseWalletPreference,
223
224
  deepLinkPreference,
224
225
  flowNetwork,
225
226
  mobileExperience,
@@ -1,4 +0,0 @@
1
- import { WalletBookSchema } from '@dynamic-labs/wallet-book';
2
- import type { WalletConnector } from '@dynamic-labs/wallet-connector-core';
3
- import { WalletOption } from '../../../types';
4
- export declare const createWallet: (walletBook: WalletBookSchema, wallet: WalletConnector) => WalletOption;
@@ -27,7 +27,7 @@ require('../../../locale/locale.cjs');
27
27
  var serializeWalletConnectors = require('../../functions/serializeWalletConnectors/serializeWalletConnectors.cjs');
28
28
  var verifyRequiredConnectorsAreSetup = require('./utils/verifyRequiredConnectorsAreSetup/verifyRequiredConnectorsAreSetup.cjs');
29
29
 
30
- const useWalletConnectorOptions = ({ projectSettings, appLogoUrl, appName, deepLinkPreference, flowNetwork, mobileExperience, networkConfigurations, walletBook, walletUiUtils, walletConnectorsProp, walletConnectPreferredChains, walletConnectorExtensions, }) => {
30
+ const useWalletConnectorOptions = ({ projectSettings, appLogoUrl, appName, coinbaseWalletPreference, deepLinkPreference, flowNetwork, mobileExperience, networkConfigurations, walletBook, walletUiUtils, walletConnectorsProp, walletConnectPreferredChains, walletConnectorExtensions, }) => {
31
31
  const walletConnectorsKey = React.useMemo(() => { var _a; return (_a = serializeWalletConnectors.serializeWalletConnectors(walletConnectorsProp)) === null || _a === void 0 ? void 0 : _a.join(','); }, [walletConnectorsProp]);
32
32
  const walletBookLength = React.useMemo(() => Object.keys(walletBook !== null && walletBook !== void 0 ? walletBook : {}).length, [walletBook]);
33
33
  const walletConnectorOptions = React.useMemo(() => {
@@ -39,6 +39,7 @@ const useWalletConnectorOptions = ({ projectSettings, appLogoUrl, appName, deepL
39
39
  getSupportedWalletOpts: {
40
40
  appLogoUrl,
41
41
  appName,
42
+ coinbaseWalletPreference,
42
43
  deepLinkPreference,
43
44
  flowNetwork,
44
45
  mobileExperience,
@@ -1,10 +1,11 @@
1
1
  import { ProjectSettings } from '@dynamic-labs/sdk-api-core';
2
- import { NetworkConfigurationMap, WalletUiUtils } from '@dynamic-labs/types';
2
+ import { type CoinbaseWalletPreference, type NetworkConfigurationMap, type WalletUiUtils } from '@dynamic-labs/types';
3
3
  import { DeepLinkVariant, WalletConnector, WalletConnectorExtension, WalletConnectorsMethod } from '@dynamic-labs/wallet-connector-core';
4
4
  import { WalletBookSchema } from '@dynamic-labs/wallet-book';
5
5
  type Props = {
6
6
  appLogoUrl?: string;
7
7
  appName?: string;
8
+ coinbaseWalletPreference?: CoinbaseWalletPreference;
8
9
  deepLinkPreference?: DeepLinkVariant;
9
10
  flowNetwork?: 'mainnet' | 'testnet';
10
11
  mobileExperience?: 'in-app-browser' | 'redirect';
@@ -16,7 +17,7 @@ type Props = {
16
17
  walletUiUtils: WalletUiUtils<WalletConnector>;
17
18
  walletConnectorExtensions?: WalletConnectorExtension[];
18
19
  };
19
- export declare const useWalletConnectorOptions: ({ projectSettings, appLogoUrl, appName, deepLinkPreference, flowNetwork, mobileExperience, networkConfigurations, walletBook, walletUiUtils, walletConnectorsProp, walletConnectPreferredChains, walletConnectorExtensions, }: Props) => {
20
+ export declare const useWalletConnectorOptions: ({ projectSettings, appLogoUrl, appName, coinbaseWalletPreference, deepLinkPreference, flowNetwork, mobileExperience, networkConfigurations, walletBook, walletUiUtils, walletConnectorsProp, walletConnectPreferredChains, walletConnectorExtensions, }: Props) => {
20
21
  walletConnectorOptions: import("../../../shared").WalletOption[];
21
22
  };
22
23
  export {};
@@ -23,7 +23,7 @@ import '../../../locale/locale.js';
23
23
  import { serializeWalletConnectors } from '../../functions/serializeWalletConnectors/serializeWalletConnectors.js';
24
24
  import { verifyRequiredConnectorsAreSetup } from './utils/verifyRequiredConnectorsAreSetup/verifyRequiredConnectorsAreSetup.js';
25
25
 
26
- const useWalletConnectorOptions = ({ projectSettings, appLogoUrl, appName, deepLinkPreference, flowNetwork, mobileExperience, networkConfigurations, walletBook, walletUiUtils, walletConnectorsProp, walletConnectPreferredChains, walletConnectorExtensions, }) => {
26
+ const useWalletConnectorOptions = ({ projectSettings, appLogoUrl, appName, coinbaseWalletPreference, deepLinkPreference, flowNetwork, mobileExperience, networkConfigurations, walletBook, walletUiUtils, walletConnectorsProp, walletConnectPreferredChains, walletConnectorExtensions, }) => {
27
27
  const walletConnectorsKey = useMemo(() => { var _a; return (_a = serializeWalletConnectors(walletConnectorsProp)) === null || _a === void 0 ? void 0 : _a.join(','); }, [walletConnectorsProp]);
28
28
  const walletBookLength = useMemo(() => Object.keys(walletBook !== null && walletBook !== void 0 ? walletBook : {}).length, [walletBook]);
29
29
  const walletConnectorOptions = useMemo(() => {
@@ -35,6 +35,7 @@ const useWalletConnectorOptions = ({ projectSettings, appLogoUrl, appName, deepL
35
35
  getSupportedWalletOpts: {
36
36
  appLogoUrl,
37
37
  appName,
38
+ coinbaseWalletPreference,
38
39
  deepLinkPreference,
39
40
  flowNetwork,
40
41
  mobileExperience,