@dynamic-labs/sdk-react-core 3.0.0-alpha.50 → 3.0.0-alpha.52
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 +34 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +13 -12
- package/src/lib/components/Typography/Typography.cjs +1 -0
- package/src/lib/components/Typography/Typography.js +1 -0
- package/src/lib/components/Typography/Typography.types.d.ts +1 -1
- package/src/lib/components/TypographyButton/TypographyButton.cjs +2 -1
- package/src/lib/components/TypographyButton/TypographyButton.js +2 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +5 -4
- package/src/lib/context/DynamicContext/DynamicContext.js +5 -4
- package/src/lib/context/DynamicContext/hooks/useSelectedWalletConnector/useSelectedWalletConnector.d.ts +1 -1
- package/src/lib/context/DynamicContext/types/SettingsOverrides.d.ts +3 -2
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.cjs +1 -0
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.js +2 -1
- package/src/lib/locale/en/translation.cjs +24 -0
- package/src/lib/locale/en/translation.d.ts +24 -0
- package/src/lib/locale/en/translation.js +24 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +8 -1
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +8 -1
- package/src/lib/shared/assets/blue-walletconnect.cjs +62 -0
- package/src/lib/shared/assets/blue-walletconnect.js +38 -0
- package/src/lib/shared/assets/index.d.ts +3 -0
- package/src/lib/store/hooks/useNetworkConfigurations/useNetworkConfigurations.cjs +19 -4
- package/src/lib/store/hooks/useNetworkConfigurations/useNetworkConfigurations.d.ts +4 -3
- package/src/lib/store/hooks/useNetworkConfigurations/useNetworkConfigurations.js +19 -4
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +1 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +2 -2
- package/src/lib/views/GlobalWalletConfirmView/GlobalWalletConfirmView.cjs +105 -0
- package/src/lib/views/GlobalWalletConfirmView/GlobalWalletConfirmView.d.ts +12 -0
- package/src/lib/views/GlobalWalletConfirmView/GlobalWalletConfirmView.js +100 -0
- package/src/lib/views/GlobalWalletConfirmView/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/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +12 -5
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +13 -6
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/DynamicWidgetViews.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/DynamicWidgetViews.js +2 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +2 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +3 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.js +2 -1
- package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.cjs +230 -0
- package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.d.ts +3 -0
- package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.js +225 -0
|
@@ -103,7 +103,18 @@ const createNetwork = (network, parser = (input) => input) => ({
|
|
|
103
103
|
rpcUrls: network.rpcUrls,
|
|
104
104
|
vanityName: network.vanityName,
|
|
105
105
|
});
|
|
106
|
-
const
|
|
106
|
+
const overrideNetworks = (networkOverrides, networks) => {
|
|
107
|
+
if (!networkOverrides) {
|
|
108
|
+
return networks;
|
|
109
|
+
}
|
|
110
|
+
if (Array.isArray(networkOverrides)) {
|
|
111
|
+
return networkOverrides;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
return networkOverrides(networks !== null && networks !== void 0 ? networks : []);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const useNetworkConfigurations = ({ environmentId, projectSettings, evmNetworksOverrides, cosmosNetworkOverrides, }) => {
|
|
107
118
|
const storedNetworks = useStoreWithSelector.useStoreWithSelector(store.getStore(), ({ networkConfigurations }) => networkConfigurations);
|
|
108
119
|
const { isLoading } = usePromise.usePromise(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
109
120
|
var _a, _b, _c, _d;
|
|
@@ -114,15 +125,19 @@ const useNetworkConfigurations = ({ environmentId, projectSettings, evmNetworksO
|
|
|
114
125
|
const solana = networks.find((configurations) => configurations.chainName === 'solana');
|
|
115
126
|
const cosmos = networks.find((configurations) => configurations.chainName === 'cosmos');
|
|
116
127
|
const starknet = networks.find((configurations) => configurations.chainName === 'starknet');
|
|
117
|
-
|
|
128
|
+
let cosmosNetworks = (_a = cosmos === null || cosmos === void 0 ? void 0 : cosmos.networks) === null || _a === void 0 ? void 0 : _a.map((net) => createNetwork(net, parseInt));
|
|
129
|
+
cosmosNetworks = overrideNetworks(cosmosNetworkOverrides, cosmosNetworks);
|
|
118
130
|
let evmNetworks = (_b = evm === null || evm === void 0 ? void 0 : evm.networks) === null || _b === void 0 ? void 0 : _b.map((net) => createNetwork(net, parseInt));
|
|
131
|
+
evmNetworks = overrideNetworks(evmNetworksOverrides, evmNetworks);
|
|
119
132
|
const starknetNetworks = (_c = starknet === null || starknet === void 0 ? void 0 : starknet.networks) === null || _c === void 0 ? void 0 : _c.map((net) => createNetwork(net));
|
|
120
133
|
const solanaNetworks = (_d = solana === null || solana === void 0 ? void 0 : solana.networks) === null || _d === void 0 ? void 0 : _d.map((net) => createNetwork(net));
|
|
121
134
|
if (evmNetworksOverrides) {
|
|
122
|
-
if (Array.isArray(evmNetworksOverrides))
|
|
135
|
+
if (Array.isArray(evmNetworksOverrides)) {
|
|
123
136
|
evmNetworks = evmNetworksOverrides;
|
|
124
|
-
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
125
139
|
evmNetworks = evmNetworksOverrides(evmNetworks !== null && evmNetworks !== void 0 ? evmNetworks : []);
|
|
140
|
+
}
|
|
126
141
|
}
|
|
127
142
|
return Promise.resolve({
|
|
128
143
|
cosmos: cosmosNetworks,
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ProjectSettings } from '@dynamic-labs/sdk-api-core';
|
|
2
2
|
import { NetworkConfigurationMap } from '@dynamic-labs/types';
|
|
3
|
-
import {
|
|
3
|
+
import { NetworksOverrides } from '../../../context/DynamicContext/types';
|
|
4
4
|
export type UseNetworkConfigurationsProps = {
|
|
5
5
|
environmentId: string;
|
|
6
6
|
projectSettings?: ProjectSettings;
|
|
7
|
-
evmNetworksOverrides?:
|
|
7
|
+
evmNetworksOverrides?: NetworksOverrides;
|
|
8
|
+
cosmosNetworkOverrides?: NetworksOverrides;
|
|
8
9
|
};
|
|
9
|
-
export declare const useNetworkConfigurations: ({ environmentId, projectSettings, evmNetworksOverrides, }: UseNetworkConfigurationsProps) => {
|
|
10
|
+
export declare const useNetworkConfigurations: ({ environmentId, projectSettings, evmNetworksOverrides, cosmosNetworkOverrides, }: UseNetworkConfigurationsProps) => {
|
|
10
11
|
isLoading: boolean;
|
|
11
12
|
networkConfigurations: NetworkConfigurationMap | undefined;
|
|
12
13
|
};
|
|
@@ -99,7 +99,18 @@ const createNetwork = (network, parser = (input) => input) => ({
|
|
|
99
99
|
rpcUrls: network.rpcUrls,
|
|
100
100
|
vanityName: network.vanityName,
|
|
101
101
|
});
|
|
102
|
-
const
|
|
102
|
+
const overrideNetworks = (networkOverrides, networks) => {
|
|
103
|
+
if (!networkOverrides) {
|
|
104
|
+
return networks;
|
|
105
|
+
}
|
|
106
|
+
if (Array.isArray(networkOverrides)) {
|
|
107
|
+
return networkOverrides;
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
return networkOverrides(networks !== null && networks !== void 0 ? networks : []);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const useNetworkConfigurations = ({ environmentId, projectSettings, evmNetworksOverrides, cosmosNetworkOverrides, }) => {
|
|
103
114
|
const storedNetworks = useStoreWithSelector(getStore(), ({ networkConfigurations }) => networkConfigurations);
|
|
104
115
|
const { isLoading } = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
105
116
|
var _a, _b, _c, _d;
|
|
@@ -110,15 +121,19 @@ const useNetworkConfigurations = ({ environmentId, projectSettings, evmNetworksO
|
|
|
110
121
|
const solana = networks.find((configurations) => configurations.chainName === 'solana');
|
|
111
122
|
const cosmos = networks.find((configurations) => configurations.chainName === 'cosmos');
|
|
112
123
|
const starknet = networks.find((configurations) => configurations.chainName === 'starknet');
|
|
113
|
-
|
|
124
|
+
let cosmosNetworks = (_a = cosmos === null || cosmos === void 0 ? void 0 : cosmos.networks) === null || _a === void 0 ? void 0 : _a.map((net) => createNetwork(net, parseInt));
|
|
125
|
+
cosmosNetworks = overrideNetworks(cosmosNetworkOverrides, cosmosNetworks);
|
|
114
126
|
let evmNetworks = (_b = evm === null || evm === void 0 ? void 0 : evm.networks) === null || _b === void 0 ? void 0 : _b.map((net) => createNetwork(net, parseInt));
|
|
127
|
+
evmNetworks = overrideNetworks(evmNetworksOverrides, evmNetworks);
|
|
115
128
|
const starknetNetworks = (_c = starknet === null || starknet === void 0 ? void 0 : starknet.networks) === null || _c === void 0 ? void 0 : _c.map((net) => createNetwork(net));
|
|
116
129
|
const solanaNetworks = (_d = solana === null || solana === void 0 ? void 0 : solana.networks) === null || _d === void 0 ? void 0 : _d.map((net) => createNetwork(net));
|
|
117
130
|
if (evmNetworksOverrides) {
|
|
118
|
-
if (Array.isArray(evmNetworksOverrides))
|
|
131
|
+
if (Array.isArray(evmNetworksOverrides)) {
|
|
119
132
|
evmNetworks = evmNetworksOverrides;
|
|
120
|
-
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
121
135
|
evmNetworks = evmNetworksOverrides(evmNetworks !== null && evmNetworks !== void 0 ? evmNetworks : []);
|
|
136
|
+
}
|
|
122
137
|
}
|
|
123
138
|
return Promise.resolve({
|
|
124
139
|
cosmos: cosmosNetworks,
|