@lifi/widget 3.32.1 → 3.33.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 +19 -0
- package/dist/esm/AppProvider.js +2 -1
- package/dist/esm/AppProvider.js.map +1 -1
- package/dist/esm/components/Header/NavigationHeader.js +4 -1
- package/dist/esm/components/Header/NavigationHeader.js.map +1 -1
- package/dist/esm/components/Tools/Tools.js +1 -1
- package/dist/esm/components/Tools/Tools.js.map +1 -1
- package/dist/esm/config/constants.d.ts +1 -1
- package/dist/esm/config/constants.js +1 -1
- package/dist/esm/config/constants.js.map +1 -1
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/hooks/useExplorer.js +2 -2
- package/dist/esm/hooks/useExplorer.js.map +1 -1
- package/dist/esm/hooks/useHeader.js +4 -1
- package/dist/esm/hooks/useHeader.js.map +1 -1
- package/dist/esm/hooks/useLanguages.d.ts +2 -3
- package/dist/esm/hooks/useLanguages.js +50 -14
- package/dist/esm/hooks/useLanguages.js.map +1 -1
- package/dist/esm/hooks/useRoutes.js +1 -1
- package/dist/esm/hooks/useRoutes.js.map +1 -1
- package/dist/esm/hooks/useSettingMonitor.js +2 -1
- package/dist/esm/hooks/useSettingMonitor.js.map +1 -1
- package/dist/esm/hooks/useTokenBalances.js +2 -1
- package/dist/esm/hooks/useTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useTools.js +2 -1
- package/dist/esm/hooks/useTools.js.map +1 -1
- package/dist/esm/pages/LanguagesPage.js +6 -1
- package/dist/esm/pages/LanguagesPage.js.map +1 -1
- package/dist/esm/pages/SelectEnabledToolsPage.js +1 -1
- package/dist/esm/pages/SelectEnabledToolsPage.js.map +1 -1
- package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js +1 -1
- package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/LanguageSetting.js +7 -2
- package/dist/esm/pages/SettingsPage/LanguageSetting.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsPage.js +14 -2
- package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/TransferIdCard.d.ts +2 -1
- package/dist/esm/pages/TransactionDetailsPage/TransferIdCard.js +3 -9
- package/dist/esm/pages/TransactionDetailsPage/TransferIdCard.js.map +1 -1
- package/dist/esm/providers/I18nProvider/I18nProvider.js +47 -41
- package/dist/esm/providers/I18nProvider/I18nProvider.js.map +1 -1
- package/dist/esm/providers/I18nProvider/constants.d.ts +3 -0
- package/dist/esm/providers/I18nProvider/constants.js +39 -0
- package/dist/esm/providers/I18nProvider/constants.js.map +1 -0
- package/dist/esm/providers/I18nProvider/enResource.d.ts +2 -0
- package/dist/esm/providers/I18nProvider/enResource.js +4 -0
- package/dist/esm/providers/I18nProvider/enResource.js.map +1 -0
- package/dist/esm/providers/I18nProvider/i18n.d.ts +3 -0
- package/dist/esm/providers/I18nProvider/i18n.js +19 -0
- package/dist/esm/providers/I18nProvider/i18n.js.map +1 -0
- package/dist/esm/providers/I18nProvider/types.d.ts +4 -11
- package/dist/esm/providers/WalletProvider/SDKProviders.js +1 -1
- package/dist/esm/providers/WalletProvider/SDKProviders.js.map +1 -1
- package/dist/esm/stores/bookmarks/createBookmarkStore.d.ts +19 -1
- package/dist/esm/stores/bookmarks/createBookmarkStore.js +3 -3
- package/dist/esm/stores/bookmarks/createBookmarkStore.js.map +1 -1
- package/dist/esm/stores/chains/ChainOrderStore.js +3 -1
- package/dist/esm/stores/chains/ChainOrderStore.js.map +1 -1
- package/dist/esm/stores/chains/createChainOrderStore.d.ts +33 -1
- package/dist/esm/stores/chains/createChainOrderStore.js +3 -3
- package/dist/esm/stores/chains/createChainOrderStore.js.map +1 -1
- package/dist/esm/stores/chains/useChainOrder.js +5 -2
- package/dist/esm/stores/chains/useChainOrder.js.map +1 -1
- package/dist/esm/stores/form/createFormStore.d.ts +1 -1
- package/dist/esm/stores/form/createFormStore.js +3 -3
- package/dist/esm/stores/form/createFormStore.js.map +1 -1
- package/dist/esm/stores/header/useHeaderStore.js +3 -3
- package/dist/esm/stores/header/useHeaderStore.js.map +1 -1
- package/dist/esm/stores/routes/createRouteExecutionStore.d.ts +17 -1
- package/dist/esm/stores/routes/createRouteExecutionStore.js +3 -3
- package/dist/esm/stores/routes/createRouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/settings/SettingsStore.d.ts +9 -0
- package/dist/esm/stores/settings/SettingsStore.js +24 -0
- package/dist/esm/stores/settings/SettingsStore.js.map +1 -0
- package/dist/esm/stores/settings/createSettingsStore.d.ts +51 -0
- package/dist/esm/stores/settings/{useSettingsStore.js → createSettingsStore.js} +38 -11
- package/dist/esm/stores/settings/createSettingsStore.js.map +1 -0
- package/dist/esm/stores/settings/types.d.ts +7 -1
- package/dist/esm/stores/settings/types.js.map +1 -1
- package/dist/esm/stores/settings/useSendToWalletStore.d.ts +1 -1
- package/dist/esm/stores/settings/useSendToWalletStore.js +3 -3
- package/dist/esm/stores/settings/useSendToWalletStore.js.map +1 -1
- package/dist/esm/stores/settings/useSettings.js +1 -1
- package/dist/esm/stores/settings/useSettings.js.map +1 -1
- package/dist/esm/stores/settings/useSettingsActions.d.ts +1 -0
- package/dist/esm/stores/settings/useSettingsActions.js +9 -1
- package/dist/esm/stores/settings/useSettingsActions.js.map +1 -1
- package/dist/esm/stores/settings/useSplitSubvariantStore.js +3 -3
- package/dist/esm/stores/settings/useSplitSubvariantStore.js.map +1 -1
- package/dist/esm/stores/settings/utils/getStateValues.js +1 -0
- package/dist/esm/stores/settings/utils/getStateValues.js.map +1 -1
- package/dist/esm/utils/converters.js +5 -0
- package/dist/esm/utils/converters.js.map +1 -1
- package/dist/esm/utils/tokenList.d.ts +1 -1
- package/dist/esm/utils/tokenList.js +3 -3
- package/dist/esm/utils/tokenList.js.map +1 -1
- package/package.json +13 -13
- package/package.json.tmp +15 -15
- package/src/AppProvider.tsx +14 -11
- package/src/components/Header/NavigationHeader.tsx +4 -1
- package/src/components/Tools/Tools.tsx +1 -1
- package/src/config/constants.ts +1 -1
- package/src/config/version.ts +1 -1
- package/src/hooks/useExplorer.ts +2 -2
- package/src/hooks/useHeader.ts +4 -1
- package/src/hooks/useLanguages.ts +73 -15
- package/src/hooks/useRoutes.ts +1 -1
- package/src/hooks/useSettingMonitor.ts +2 -4
- package/src/hooks/useTokenBalances.ts +2 -1
- package/src/hooks/useTools.ts +3 -1
- package/src/pages/LanguagesPage.tsx +10 -1
- package/src/pages/SelectEnabledToolsPage.tsx +1 -1
- package/src/pages/SettingsPage/BridgeAndExchangeSettings.tsx +1 -1
- package/src/pages/SettingsPage/LanguageSetting.tsx +9 -2
- package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx +1 -1
- package/src/pages/TransactionDetailsPage/TransactionDetailsPage.tsx +25 -5
- package/src/pages/TransactionDetailsPage/TransferIdCard.tsx +8 -13
- package/src/providers/I18nProvider/I18nProvider.tsx +66 -51
- package/src/providers/I18nProvider/constants.ts +41 -0
- package/src/providers/I18nProvider/enResource.ts +4 -0
- package/src/providers/I18nProvider/i18n.ts +26 -0
- package/src/providers/I18nProvider/types.ts +21 -12
- package/src/providers/WalletProvider/SDKProviders.tsx +2 -1
- package/src/stores/bookmarks/createBookmarkStore.ts +3 -5
- package/src/stores/chains/ChainOrderStore.tsx +3 -1
- package/src/stores/chains/createChainOrderStore.ts +3 -5
- package/src/stores/chains/useChainOrder.ts +10 -2
- package/src/stores/form/createFormStore.ts +3 -3
- package/src/stores/header/useHeaderStore.tsx +31 -34
- package/src/stores/routes/createRouteExecutionStore.ts +3 -5
- package/src/stores/settings/SettingsStore.tsx +45 -0
- package/src/stores/settings/createSettingsStore.ts +223 -0
- package/src/stores/settings/types.ts +8 -1
- package/src/stores/settings/useSendToWalletStore.ts +8 -11
- package/src/stores/settings/useSettings.ts +1 -1
- package/src/stores/settings/useSettingsActions.ts +13 -4
- package/src/stores/settings/useSplitSubvariantStore.tsx +9 -12
- package/src/stores/settings/utils/getStateValues.ts +1 -0
- package/src/themes/types.ts +0 -3
- package/src/utils/converters.ts +5 -0
- package/src/utils/tokenList.ts +3 -3
- package/dist/esm/i18n/index.d.ts +0 -16
- package/dist/esm/i18n/index.js +0 -17
- package/dist/esm/i18n/index.js.map +0 -1
- package/dist/esm/stores/settings/useSettingsStore.d.ts +0 -5
- package/dist/esm/stores/settings/useSettingsStore.js.map +0 -1
- package/src/i18n/index.ts +0 -17
- package/src/stores/settings/useSettingsStore.ts +0 -185
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/** biome-ignore-all lint/correctness/noUnusedVariables: allowed in this store */
|
|
2
|
+
import { create } from 'zustand'
|
|
3
|
+
import { persist } from 'zustand/middleware'
|
|
4
|
+
import { allLanguages } from '../../providers/I18nProvider/constants.js'
|
|
5
|
+
import { loadLocale } from '../../providers/I18nProvider/i18n.js'
|
|
6
|
+
import type { LanguageKey } from '../../providers/I18nProvider/types.js'
|
|
7
|
+
import type { WidgetConfig } from '../../types/widget.js'
|
|
8
|
+
import type { SettingsProps, SettingsState } from './types.js'
|
|
9
|
+
import { SettingsToolTypes } from './types.js'
|
|
10
|
+
import { getStateValues } from './utils/getStateValues.js'
|
|
11
|
+
|
|
12
|
+
export const defaultSlippage = undefined
|
|
13
|
+
|
|
14
|
+
export const defaultConfigurableSettings: Pick<
|
|
15
|
+
SettingsState,
|
|
16
|
+
'routePriority' | 'slippage' | 'gasPrice'
|
|
17
|
+
> = {
|
|
18
|
+
routePriority: 'CHEAPEST',
|
|
19
|
+
slippage: defaultSlippage,
|
|
20
|
+
gasPrice: 'normal',
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const defaultSettings: SettingsProps = {
|
|
24
|
+
gasPrice: 'normal',
|
|
25
|
+
enabledAutoRefuel: true,
|
|
26
|
+
disabledBridges: [],
|
|
27
|
+
disabledExchanges: [],
|
|
28
|
+
enabledBridges: [],
|
|
29
|
+
enabledExchanges: [],
|
|
30
|
+
_enabledBridges: {},
|
|
31
|
+
_enabledExchanges: {},
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const createSettingsStore = (config: WidgetConfig) =>
|
|
35
|
+
create<SettingsState>()(
|
|
36
|
+
persist(
|
|
37
|
+
(set, get) => ({
|
|
38
|
+
...defaultSettings,
|
|
39
|
+
setValue: (key, value) =>
|
|
40
|
+
set(() => ({
|
|
41
|
+
[key]: value,
|
|
42
|
+
})),
|
|
43
|
+
setValues: (values: Partial<SettingsProps>) =>
|
|
44
|
+
set(() => ({
|
|
45
|
+
...values,
|
|
46
|
+
})),
|
|
47
|
+
getSettings: () => getStateValues(get()),
|
|
48
|
+
getValue: (key) => get()[key],
|
|
49
|
+
initializeTools: (toolType, tools, reset) => {
|
|
50
|
+
if (!tools.length) {
|
|
51
|
+
return
|
|
52
|
+
}
|
|
53
|
+
set((state) => {
|
|
54
|
+
const updatedState = { ...state }
|
|
55
|
+
if (!reset) {
|
|
56
|
+
// Add new tools
|
|
57
|
+
tools.forEach((tool) => {
|
|
58
|
+
if (!Object.hasOwn(updatedState[`_enabled${toolType}`], tool)) {
|
|
59
|
+
updatedState[`_enabled${toolType}`][tool] = true
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
// Filter tools we no longer have
|
|
63
|
+
updatedState[`_enabled${toolType}`] = Object.fromEntries(
|
|
64
|
+
Object.entries(updatedState[`_enabled${toolType}`]).filter(
|
|
65
|
+
([key]) => tools.includes(key)
|
|
66
|
+
)
|
|
67
|
+
)
|
|
68
|
+
} else {
|
|
69
|
+
tools.forEach((tool) => {
|
|
70
|
+
updatedState[`_enabled${toolType}`][tool] = true
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
const enabledToolKeys = Object.keys(
|
|
74
|
+
updatedState[`_enabled${toolType}`]
|
|
75
|
+
)
|
|
76
|
+
updatedState[`enabled${toolType}`] = enabledToolKeys.filter(
|
|
77
|
+
(key) => updatedState[`_enabled${toolType}`][key]
|
|
78
|
+
)
|
|
79
|
+
updatedState[`disabled${toolType}`] = enabledToolKeys.filter(
|
|
80
|
+
(key) => !updatedState[`_enabled${toolType}`][key]
|
|
81
|
+
)
|
|
82
|
+
return updatedState
|
|
83
|
+
})
|
|
84
|
+
},
|
|
85
|
+
setToolValue: (toolType, tool, value) =>
|
|
86
|
+
set((state) => {
|
|
87
|
+
const enabledTools = {
|
|
88
|
+
...state[`_enabled${toolType}`],
|
|
89
|
+
[tool]: value,
|
|
90
|
+
}
|
|
91
|
+
const enabledToolKeys = Object.keys(enabledTools)
|
|
92
|
+
return {
|
|
93
|
+
[`_enabled${toolType}`]: enabledTools,
|
|
94
|
+
[`enabled${toolType}`]: enabledToolKeys.filter(
|
|
95
|
+
(key) => enabledTools[key]
|
|
96
|
+
),
|
|
97
|
+
[`disabled${toolType}`]: enabledToolKeys.filter(
|
|
98
|
+
(key) => !enabledTools[key]
|
|
99
|
+
),
|
|
100
|
+
}
|
|
101
|
+
}),
|
|
102
|
+
toggleToolKeys: (toolType, toolKeys) =>
|
|
103
|
+
set((state) => {
|
|
104
|
+
const allKeysInCollectionEnabled = toolKeys.every(
|
|
105
|
+
(toolKey) => state[`_enabled${toolType}`][toolKey]
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
// then toggle those keys to false
|
|
109
|
+
const updatedTools = toolKeys.reduce(
|
|
110
|
+
(accum, toolKey) => {
|
|
111
|
+
accum[toolKey] = !allKeysInCollectionEnabled
|
|
112
|
+
return accum
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
...state[`_enabled${toolType}`],
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
const enableKeys: string[] = []
|
|
120
|
+
const disabledKeys: string[] = []
|
|
121
|
+
|
|
122
|
+
Object.entries(updatedTools).forEach(([key, value]) => {
|
|
123
|
+
if (value) {
|
|
124
|
+
enableKeys.push(key)
|
|
125
|
+
} else {
|
|
126
|
+
disabledKeys.push(key)
|
|
127
|
+
}
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
return {
|
|
131
|
+
[`_enabled${toolType}`]: updatedTools,
|
|
132
|
+
[`enabled${toolType}`]: enableKeys,
|
|
133
|
+
[`disabled${toolType}`]: disabledKeys,
|
|
134
|
+
}
|
|
135
|
+
}),
|
|
136
|
+
reset: (bridges, exchanges) => {
|
|
137
|
+
set(() => ({
|
|
138
|
+
...defaultSettings,
|
|
139
|
+
...defaultConfigurableSettings,
|
|
140
|
+
}))
|
|
141
|
+
get().initializeTools('Bridges', bridges, true)
|
|
142
|
+
get().initializeTools('Exchanges', exchanges, true)
|
|
143
|
+
return { ...get() }
|
|
144
|
+
},
|
|
145
|
+
}),
|
|
146
|
+
{
|
|
147
|
+
name: 'li.fi-widget-settings',
|
|
148
|
+
version: 5,
|
|
149
|
+
partialize: (state) => {
|
|
150
|
+
const {
|
|
151
|
+
disabledBridges,
|
|
152
|
+
disabledExchanges,
|
|
153
|
+
enabledBridges,
|
|
154
|
+
enabledExchanges,
|
|
155
|
+
...partializedState
|
|
156
|
+
} = state
|
|
157
|
+
return partializedState
|
|
158
|
+
},
|
|
159
|
+
merge: (persistedState: any, currentState: SettingsState) => {
|
|
160
|
+
const state = { ...currentState, ...persistedState }
|
|
161
|
+
SettingsToolTypes.forEach((toolType) => {
|
|
162
|
+
if (persistedState?.[`_enabled${toolType}`]) {
|
|
163
|
+
const enabledToolKeys = Object.keys(
|
|
164
|
+
persistedState[`_enabled${toolType}`]
|
|
165
|
+
)
|
|
166
|
+
state[`enabled${toolType}`] = enabledToolKeys.filter(
|
|
167
|
+
(key) => persistedState[`_enabled${toolType}`][key]
|
|
168
|
+
)
|
|
169
|
+
state[`disabled${toolType}`] = enabledToolKeys.filter(
|
|
170
|
+
(key) => !persistedState[`_enabled${toolType}`][key]
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
})
|
|
174
|
+
return state
|
|
175
|
+
},
|
|
176
|
+
migrate: (persistedState: any, version) => {
|
|
177
|
+
if (version === 1) {
|
|
178
|
+
persistedState.slippage = defaultConfigurableSettings.slippage
|
|
179
|
+
}
|
|
180
|
+
if (version <= 3) {
|
|
181
|
+
persistedState.routePriority = 'CHEAPEST'
|
|
182
|
+
}
|
|
183
|
+
return persistedState as SettingsState
|
|
184
|
+
},
|
|
185
|
+
onRehydrateStorage: () => {
|
|
186
|
+
const initializeLanguageSettings = async (
|
|
187
|
+
state: SettingsState,
|
|
188
|
+
initialLanguage?: string
|
|
189
|
+
) => {
|
|
190
|
+
const customLanguages = Object.keys(
|
|
191
|
+
config?.languageResources || {}
|
|
192
|
+
).filter((key) => !allLanguages.includes(key as LanguageKey))
|
|
193
|
+
if (
|
|
194
|
+
initialLanguage &&
|
|
195
|
+
// Custom language resources and English are added statically.
|
|
196
|
+
initialLanguage !== 'en' &&
|
|
197
|
+
!customLanguages.includes(initialLanguage)
|
|
198
|
+
) {
|
|
199
|
+
await loadLocale(
|
|
200
|
+
initialLanguage as LanguageKey,
|
|
201
|
+
config?.languageResources?.[initialLanguage as LanguageKey]
|
|
202
|
+
).then((languageResource) => {
|
|
203
|
+
state.setValues({
|
|
204
|
+
language: initialLanguage,
|
|
205
|
+
languageCache: languageResource,
|
|
206
|
+
})
|
|
207
|
+
})
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return (state?: SettingsState) => {
|
|
211
|
+
// Preload translations (from existing translation files)
|
|
212
|
+
if (state) {
|
|
213
|
+
// NB: State always exists unless there is any error
|
|
214
|
+
initializeLanguageSettings(
|
|
215
|
+
state,
|
|
216
|
+
state.getValue('language') || config?.languages?.default
|
|
217
|
+
)
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
)
|
|
@@ -2,7 +2,8 @@ import type { Order } from '@lifi/sdk'
|
|
|
2
2
|
import type { PropsWithChildren } from 'react'
|
|
3
3
|
import type { StoreApi } from 'zustand'
|
|
4
4
|
import type { UseBoundStoreWithEqualityFn } from 'zustand/traditional'
|
|
5
|
-
import type {
|
|
5
|
+
import type { LanguageResource } from '../../providers/I18nProvider/types.js'
|
|
6
|
+
import type { SplitSubvariant, WidgetConfig } from '../../types/widget.js'
|
|
6
7
|
|
|
7
8
|
export type ValueSetter<S> = <K extends keyof S>(
|
|
8
9
|
key: K,
|
|
@@ -17,6 +18,7 @@ export type SettingsToolType = (typeof SettingsToolTypes)[number]
|
|
|
17
18
|
export interface SettingsProps {
|
|
18
19
|
gasPrice?: string
|
|
19
20
|
language?: string
|
|
21
|
+
languageCache?: LanguageResource
|
|
20
22
|
routePriority?: Order
|
|
21
23
|
enabledAutoRefuel: boolean
|
|
22
24
|
slippage?: string
|
|
@@ -30,6 +32,7 @@ export interface SettingsProps {
|
|
|
30
32
|
|
|
31
33
|
export interface SettingsActions {
|
|
32
34
|
setValue: ValueSetter<SettingsProps>
|
|
35
|
+
setValues: (values: Partial<SettingsProps>) => void
|
|
33
36
|
getValue: ValueGetter<SettingsProps>
|
|
34
37
|
getSettings: () => SettingsProps
|
|
35
38
|
initializeTools(
|
|
@@ -67,3 +70,7 @@ export interface SplitSubvariantProps {
|
|
|
67
70
|
|
|
68
71
|
export type SplitSubvariantProviderProps =
|
|
69
72
|
PropsWithChildren<SplitSubvariantProps>
|
|
73
|
+
|
|
74
|
+
export interface SettingsStoreProviderProps {
|
|
75
|
+
config: WidgetConfig
|
|
76
|
+
}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
+
import { create } from 'zustand'
|
|
1
2
|
import { useShallow } from 'zustand/shallow'
|
|
2
|
-
import { createWithEqualityFn } from 'zustand/traditional'
|
|
3
3
|
import type { SendToWalletStore } from './types.js'
|
|
4
4
|
|
|
5
|
-
export const sendToWalletStore =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}),
|
|
13
|
-
Object.is
|
|
14
|
-
)
|
|
5
|
+
export const sendToWalletStore = create<SendToWalletStore>((set) => ({
|
|
6
|
+
showSendToWallet: false,
|
|
7
|
+
setSendToWallet: (value) =>
|
|
8
|
+
set({
|
|
9
|
+
showSendToWallet: value,
|
|
10
|
+
}),
|
|
11
|
+
}))
|
|
15
12
|
|
|
16
13
|
export const useSendToWalletStore = <T>(
|
|
17
14
|
selector: (state: SendToWalletStore) => T
|
|
@@ -4,16 +4,14 @@ import { useWidgetEvents } from '../../hooks/useWidgetEvents.js'
|
|
|
4
4
|
import { WidgetEvent } from '../../types/events.js'
|
|
5
5
|
import type { WidgetConfig } from '../../types/widget.js'
|
|
6
6
|
import { deepEqual } from '../../utils/deepEqual.js'
|
|
7
|
+
import { defaultConfigurableSettings } from './createSettingsStore.js'
|
|
8
|
+
import { useSettingsStore } from './SettingsStore.js'
|
|
7
9
|
import type {
|
|
8
10
|
SettingsActions,
|
|
9
11
|
SettingsProps,
|
|
10
12
|
SettingsToolType,
|
|
11
13
|
ValueSetter,
|
|
12
14
|
} from './types.js'
|
|
13
|
-
import {
|
|
14
|
-
defaultConfigurableSettings,
|
|
15
|
-
useSettingsStore,
|
|
16
|
-
} from './useSettingsStore.js'
|
|
17
15
|
|
|
18
16
|
const emitEventOnChange = <T extends (...args: any[]) => any>(
|
|
19
17
|
emitter: typeof widgetEvents,
|
|
@@ -48,6 +46,7 @@ export const useSettingsActions = () => {
|
|
|
48
46
|
const emitter = useWidgetEvents()
|
|
49
47
|
const actions = useSettingsStore((state) => ({
|
|
50
48
|
setValue: state.setValue,
|
|
49
|
+
setValues: state.setValues,
|
|
51
50
|
getValue: state.getValue,
|
|
52
51
|
getSettings: state.getSettings,
|
|
53
52
|
reset: state.reset,
|
|
@@ -63,6 +62,15 @@ export const useSettingsActions = () => {
|
|
|
63
62
|
[emitter, actions]
|
|
64
63
|
)
|
|
65
64
|
|
|
65
|
+
const setValuesWithEmittedEvent = useCallback(
|
|
66
|
+
(values: Partial<SettingsProps>) => {
|
|
67
|
+
Object.entries(values).forEach(([key, value]) => {
|
|
68
|
+
setValueWithEmittedEvent(key as keyof SettingsProps, value)
|
|
69
|
+
})
|
|
70
|
+
},
|
|
71
|
+
[setValueWithEmittedEvent]
|
|
72
|
+
)
|
|
73
|
+
|
|
66
74
|
const setDefaultSettingsWithEmittedEvents = useCallback(
|
|
67
75
|
(config?: WidgetConfig) => {
|
|
68
76
|
const slippage = actions.getValue('slippage')
|
|
@@ -140,6 +148,7 @@ export const useSettingsActions = () => {
|
|
|
140
148
|
|
|
141
149
|
return {
|
|
142
150
|
setValue: setValueWithEmittedEvent,
|
|
151
|
+
setValues: setValuesWithEmittedEvent,
|
|
143
152
|
setDefaultSettings: setDefaultSettingsWithEmittedEvents,
|
|
144
153
|
resetSettings: resetWithEmittedEvents,
|
|
145
154
|
setToolValue: setToolValueWithEmittedEvents,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext, useContext, useRef } from 'react'
|
|
2
|
+
import { create } from 'zustand'
|
|
2
3
|
import { useShallow } from 'zustand/shallow'
|
|
3
|
-
import { createWithEqualityFn } from 'zustand/traditional'
|
|
4
4
|
import type {
|
|
5
5
|
SplitSubvariantProps,
|
|
6
6
|
SplitSubvariantProviderProps,
|
|
@@ -53,14 +53,11 @@ export function useSplitSubvariantStore<T>(
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
const createSplitSubvariantStore = ({ state }: SplitSubvariantProps) =>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}),
|
|
65
|
-
Object.is
|
|
66
|
-
)
|
|
56
|
+
create<SplitSubvariantState>((set) => ({
|
|
57
|
+
state,
|
|
58
|
+
setState(state) {
|
|
59
|
+
set(() => ({
|
|
60
|
+
state,
|
|
61
|
+
}))
|
|
62
|
+
},
|
|
63
|
+
}))
|
|
@@ -3,6 +3,7 @@ import type { SettingsProps, SettingsState } from '../types.js'
|
|
|
3
3
|
export const getStateValues = (state: SettingsState): SettingsProps => ({
|
|
4
4
|
gasPrice: state.gasPrice,
|
|
5
5
|
language: state.language,
|
|
6
|
+
languageCache: state.languageCache,
|
|
6
7
|
routePriority: state.routePriority,
|
|
7
8
|
enabledAutoRefuel: state.enabledAutoRefuel,
|
|
8
9
|
slippage: state.slippage,
|
package/src/themes/types.ts
CHANGED
|
@@ -10,9 +10,6 @@ import type {} from '@mui/material/themeCssVarsAugmentation'
|
|
|
10
10
|
import type { CSSProperties } from 'react'
|
|
11
11
|
import type { NavigationProps } from '../types/widget.js'
|
|
12
12
|
|
|
13
|
-
// @mui/icons-material ESM issue
|
|
14
|
-
// https://github.com/mui/material-ui/issues/30671
|
|
15
|
-
|
|
16
13
|
// https://mui.com/customization/palette/
|
|
17
14
|
declare module '@mui/material/styles' {
|
|
18
15
|
interface TypographyVariants {
|
package/src/utils/converters.ts
CHANGED
|
@@ -30,6 +30,7 @@ const buildProcessFromTxHistory = (tx: FullStatusData): Process[] => {
|
|
|
30
30
|
startedAt: sending.timestamp ?? Date.now(),
|
|
31
31
|
message: '',
|
|
32
32
|
status: processStatus,
|
|
33
|
+
chainId: sending.chainId,
|
|
33
34
|
txHash: sending.txHash,
|
|
34
35
|
txLink: sending.txLink,
|
|
35
36
|
doneAt: receiving.timestamp ?? Date.now(),
|
|
@@ -45,6 +46,7 @@ const buildProcessFromTxHistory = (tx: FullStatusData): Process[] => {
|
|
|
45
46
|
startedAt: sending.timestamp ?? Date.now(),
|
|
46
47
|
message: '',
|
|
47
48
|
status: processStatus, // can be FAILED
|
|
49
|
+
chainId: sending.chainId,
|
|
48
50
|
txHash: sending.txHash,
|
|
49
51
|
txLink: sending.txLink,
|
|
50
52
|
doneAt: sending.timestamp,
|
|
@@ -57,6 +59,7 @@ const buildProcessFromTxHistory = (tx: FullStatusData): Process[] => {
|
|
|
57
59
|
substatus,
|
|
58
60
|
substatusMessage: '',
|
|
59
61
|
doneAt: receiving.timestamp ?? Date.now(),
|
|
62
|
+
chainId: receiving.chainId,
|
|
60
63
|
txHash: receiving.txHash,
|
|
61
64
|
txLink: receiving.txLink,
|
|
62
65
|
},
|
|
@@ -211,6 +214,8 @@ export const buildRouteFromTxHistory = (
|
|
|
211
214
|
fromAmount: sending.amount,
|
|
212
215
|
toAmount: receiving.amount,
|
|
213
216
|
toToken: receiving.token,
|
|
217
|
+
internalTxLink: tx.lifiExplorerLink,
|
|
218
|
+
externalTxLink: tx.bridgeExplorerLink,
|
|
214
219
|
gasCosts: [
|
|
215
220
|
{
|
|
216
221
|
amount: sending.gasAmount,
|
package/src/utils/tokenList.ts
CHANGED
|
@@ -14,14 +14,14 @@ const sortByVolume = (a: TokenExtended, b: TokenExtended) =>
|
|
|
14
14
|
|
|
15
15
|
export const processTokenBalances = (
|
|
16
16
|
isBalanceLoading: boolean,
|
|
17
|
-
|
|
17
|
+
noCategories: boolean,
|
|
18
18
|
configTokens?: WidgetTokens,
|
|
19
19
|
selectedChainId?: number,
|
|
20
20
|
tokens?: TokenExtended[],
|
|
21
21
|
tokensWithBalances?: TokenAmount[]
|
|
22
22
|
) => {
|
|
23
23
|
if (isBalanceLoading) {
|
|
24
|
-
if (
|
|
24
|
+
if (noCategories) {
|
|
25
25
|
const sortedTokens = [...(tokens ?? [])].sort(sortByVolume)
|
|
26
26
|
return {
|
|
27
27
|
processedTokens: sortedTokens,
|
|
@@ -54,7 +54,7 @@ export const processTokenBalances = (
|
|
|
54
54
|
})
|
|
55
55
|
.sort(sortByVolume) ?? []
|
|
56
56
|
|
|
57
|
-
if (
|
|
57
|
+
if (noCategories) {
|
|
58
58
|
return {
|
|
59
59
|
processedTokens: [...sortedTokensWithBalances, ...tokensWithoutBalances],
|
|
60
60
|
withCategories: false,
|
package/dist/esm/i18n/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import bn from './bn.json';
|
|
2
|
-
import de from './de.json';
|
|
3
|
-
import en from './en.json';
|
|
4
|
-
import es from './es.json';
|
|
5
|
-
import fr from './fr.json';
|
|
6
|
-
import id from './id.json';
|
|
7
|
-
import it from './it.json';
|
|
8
|
-
import ja from './ja.json';
|
|
9
|
-
import ko from './ko.json';
|
|
10
|
-
import pt from './pt.json';
|
|
11
|
-
import th from './th.json';
|
|
12
|
-
import tr from './tr.json';
|
|
13
|
-
import uk from './uk.json';
|
|
14
|
-
import vi from './vi.json';
|
|
15
|
-
import zh from './zh.json';
|
|
16
|
-
export { bn, de, en, es, fr, id, it, ja, ko, pt, th, tr, uk, vi, zh };
|
package/dist/esm/i18n/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import bn from './bn.json' with { type: 'json' };
|
|
2
|
-
import de from './de.json' with { type: 'json' };
|
|
3
|
-
import en from './en.json' with { type: 'json' };
|
|
4
|
-
import es from './es.json' with { type: 'json' };
|
|
5
|
-
import fr from './fr.json' with { type: 'json' };
|
|
6
|
-
import id from './id.json' with { type: 'json' };
|
|
7
|
-
import it from './it.json' with { type: 'json' };
|
|
8
|
-
import ja from './ja.json' with { type: 'json' };
|
|
9
|
-
import ko from './ko.json' with { type: 'json' };
|
|
10
|
-
import pt from './pt.json' with { type: 'json' };
|
|
11
|
-
import th from './th.json' with { type: 'json' };
|
|
12
|
-
import tr from './tr.json' with { type: 'json' };
|
|
13
|
-
import uk from './uk.json' with { type: 'json' };
|
|
14
|
-
import vi from './vi.json' with { type: 'json' };
|
|
15
|
-
import zh from './zh.json' with { type: 'json' };
|
|
16
|
-
export { bn, de, en, es, fr, id, it, ja, ko, pt, th, tr, uk, vi, zh };
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,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E,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { SettingsState } from './types.js';
|
|
2
|
-
export declare const defaultSlippage: undefined;
|
|
3
|
-
export declare const defaultConfigurableSettings: Pick<SettingsState, 'routePriority' | 'slippage' | 'gasPrice'>;
|
|
4
|
-
export declare const settingsStore: import("zustand/traditional").UseBoundStoreWithEqualityFn<import("zustand").StoreApi<SettingsState>>;
|
|
5
|
-
export declare const useSettingsStore: <T>(selector: (state: SettingsState) => T) => T;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSettingsStore.js","sourceRoot":"","sources":["../../../../src/stores/settings/useSettingsStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE1D,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAA;AAExC,MAAM,CAAC,MAAM,2BAA2B,GAGpC;IACF,aAAa,EAAE,UAAU;IACzB,QAAQ,EAAE,eAAe;IACzB,QAAQ,EAAE,QAAQ;CACnB,CAAA;AAED,MAAM,eAAe,GAAkB;IACrC,QAAQ,EAAE,QAAQ;IAClB,iBAAiB,EAAE,IAAI;IACvB,eAAe,EAAE,EAAE;IACnB,iBAAiB,EAAE,EAAE;IACrB,cAAc,EAAE,EAAE;IAClB,gBAAgB,EAAE,EAAE;IACpB,eAAe,EAAE,EAAE;IACnB,iBAAiB,EAAE,EAAE;CACtB,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,oBAAoB,CAC/C,OAAO,CACL,CAAC,GAAG,EAAE,GAAG,EAAE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EAAE,OAAO,EAAE,EAAE;QACxC,IAAI,OAAO,KAAK,CAAC,EAAE,CAAC;YAClB,cAAc,CAAC,QAAQ,GAAG,2BAA2B,CAAC,QAAQ,CAAA;QAChE,CAAC;QACD,IAAI,OAAO,IAAI,CAAC,EAAE,CAAC;YACjB,cAAc,CAAC,aAAa,GAAG,UAAU,CAAA;QAC3C,CAAC;QACD,OAAO,cAA+B,CAAA;IACxC,CAAC;CACF,CACoD,EACvD,MAAM,CAAC,EAAE,CACV,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,QAAqC,EAClC,EAAE;IACL,OAAO,aAAa,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAA;AAC5C,CAAC,CAAA"}
|
package/src/i18n/index.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import bn from './bn.json' with { type: 'json' }
|
|
2
|
-
import de from './de.json' with { type: 'json' }
|
|
3
|
-
import en from './en.json' with { type: 'json' }
|
|
4
|
-
import es from './es.json' with { type: 'json' }
|
|
5
|
-
import fr from './fr.json' with { type: 'json' }
|
|
6
|
-
import id from './id.json' with { type: 'json' }
|
|
7
|
-
import it from './it.json' with { type: 'json' }
|
|
8
|
-
import ja from './ja.json' with { type: 'json' }
|
|
9
|
-
import ko from './ko.json' with { type: 'json' }
|
|
10
|
-
import pt from './pt.json' with { type: 'json' }
|
|
11
|
-
import th from './th.json' with { type: 'json' }
|
|
12
|
-
import tr from './tr.json' with { type: 'json' }
|
|
13
|
-
import uk from './uk.json' with { type: 'json' }
|
|
14
|
-
import vi from './vi.json' with { type: 'json' }
|
|
15
|
-
import zh from './zh.json' with { type: 'json' }
|
|
16
|
-
|
|
17
|
-
export { bn, de, en, es, fr, id, it, ja, ko, pt, th, tr, uk, vi, zh }
|