Skip to content

Commit

Permalink
feat: create pool error
Browse files Browse the repository at this point in the history
  • Loading branch information
junjieit committed Oct 24, 2024
1 parent 241fc8d commit 1f7d016
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 151 deletions.
2 changes: 1 addition & 1 deletion packages/dodoex-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dodoex/api",
"version": "3.0.0-taiko.10",
"version": "3.0.0-taiko.11",
"description": "DODO API Kit",
"source": "src/index.ts",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/dodoex-api/src/chainConfig/contractConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ const contractMap: {
ROUTE_V1_DATA_FETCH: '0x187210CE04F5B3179F0e483FCf292c34BA7568Dd',
CALLEE_HELPER: '0x94B66F3156353a12A6004d098A16F2fCfF9E8348',

DODO_PROXY: '0x7fB45a8AcA7DD30a136569B5E3eb7E1F1f0235a0',
DODO_PROXY: '0xfcd8EF54A4dA96dE6B2DDF67C6265C7405a3A9c6',
DODO_DSP_PROXY: '0x928e9762B5223d5A2ac1F5b13E8A61907aCaa9Bd',
DODO_DPP_PROXY: '0x38886EDE1Fc92886F9a11C37a1f5e75474858eaa',
DODO_MINEV3_PROXY: '0x1dFd36964e21a2eb633991f0B95b4241c20e1db3',
Expand Down
4 changes: 2 additions & 2 deletions packages/dodoex-widgets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dodoex/widgets",
"version": "3.0.0-taiko.22",
"version": "3.0.0-taiko.23",
"description": "DODO Widgets",
"source": "src/index.tsx",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -57,7 +57,7 @@
},
"dependencies": {
"@babel/runtime": "^7.17.0",
"@dodoex/api": ">=3.0.0-taiko.10",
"@dodoex/api": ">=3.0.0-taiko.11",
"@dodoex/components": ">=3.0.0-taiko.5",
"@dodoex/icons": "^2.0.1",
"@emotion/react": "^11.10.0",
Expand Down
44 changes: 13 additions & 31 deletions packages/dodoex-widgets/src/components/Widget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { DefaultTokenInfo, TokenInfo } from '../../hooks/Token/type';
import useInitTokenList, {
InitTokenListProps,
} from '../../hooks/Token/useInitTokenList';
import { LangProvider } from '../../providers/i18n';
import { LangProvider as LangProviderBase } from '../../providers/i18n';
import { queryClient } from '../../providers/queryClient';
import { store } from '../../store';
import { AppThunkDispatch } from '../../store/actions';
Expand Down Expand Up @@ -100,6 +100,17 @@ export interface WidgetProps
DialogComponent?: React.FunctionComponent<DialogProps>;
}

function LangProvider(props: PropsWithChildren<WidgetProps>) {
if (props.noLangProvider) {
return <>{props.children}</>;
}
return (
<LangProviderBase locale={props.locale}>
<WithExecutionDialog {...props}>{props.children}</WithExecutionDialog>
</LangProviderBase>
);
}

function InitStatus(props: PropsWithChildren<WidgetProps>) {
useInitTokenList(props);
useFetchBlockNumber();
Expand Down Expand Up @@ -174,36 +185,9 @@ function InitStatus(props: PropsWithChildren<WidgetProps>) {
const { widgetRef } = useUserOptions();

if (props.noUI) {
if (props.noLangProvider) {
return <>{props.children}</>;
}
return <LangProvider locale={props.locale}>{props.children}</LangProvider>;
}

if (props.noLangProvider) {
return (
<Box
sx={{
width,
height,
overflow: 'hidden',
position: 'relative',
display: 'flex',
flexDirection: 'column',
minWidth: 335,
minHeight: 494,
borderRadius: 16,
backgroundColor: 'background.paper',
}}
className={WIDGET_CLASS_NAME}
ref={widgetRef}
>
<OpenConnectWalletInfo />
{props.children}
</Box>
);
}

return (
<LangProvider locale={props.locale}>
<Box
Expand Down Expand Up @@ -243,9 +227,7 @@ function Web3Provider(props: PropsWithChildren<WidgetProps>) {

return (
<Web3ReactProvider connectors={connectors} key={key} lookupENS={false}>
<WithExecutionDialog {...props}>
<InitStatus {...props} />
</WithExecutionDialog>
<InitStatus {...props} />
</Web3ReactProvider>
);
}
Expand Down
106 changes: 53 additions & 53 deletions packages/dodoex-widgets/src/locales/en-US.po
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ msgstr "To"
msgid "{0} pending"
msgstr "{0} pending"

#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:324
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:341
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:479
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:325
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:342
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:480
msgid "Removing"
msgstr "Removing"

Expand Down Expand Up @@ -111,9 +111,9 @@ msgstr "Dismiss"
msgid "Unstaking"
msgstr "Unstaking"

#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:327
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:344
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:482
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:328
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:345
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:483
msgid "Adding"
msgstr "Adding"

Expand Down Expand Up @@ -249,7 +249,7 @@ msgstr "Edit Parameter Settings"
msgid "Hour"
msgstr "Hour"

#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:164
#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:167
#: src/widgets/PoolWidget/PoolCreate/components/StepTitle.tsx:28
#: src/widgets/PoolWidget/PoolCreate/index.tsx:301
msgid "Pricing Model"
Expand Down Expand Up @@ -289,7 +289,7 @@ msgstr "Fee includes: Cross Chain fees + Swap fees. Gas fee not included."
#: src/components/SwitchChainDialog/index.tsx:139
#: src/components/WidgetConfirm.tsx:130
#: src/widgets/MiningWidget/MiningCreate/components/StepTitle.tsx:50
#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:194
#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:197
#: src/widgets/PoolWidget/PoolCreate/operate-widgets/SlippageCoefficientSetting.tsx:240
#: src/widgets/PoolWidget/PoolModify/operate-widgets/BottomButtonGroup.tsx:74
#: src/widgets/PoolWidget/PoolModify/operate-widgets/FeeRateSetting.tsx:197
Expand All @@ -304,7 +304,7 @@ msgstr "Powered by DODO protocol"
msgid "Fees (24H)"
msgstr "Fees (24H)"

#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:104
#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:107
msgid "Initial Tokens"
msgstr "Initial Tokens"

Expand Down Expand Up @@ -388,13 +388,13 @@ msgstr "All Mining"
msgid "Amount of token rewards"
msgstr "Amount of token rewards"

#: src/components/List/EmptyList.tsx:30
#: src/components/List/EmptyList.tsx:37
msgid "No results found"
msgstr "No results found"

#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:273
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:295
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:391
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:274
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:296
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:392
msgid "Pair"
msgstr "Pair"

Expand Down Expand Up @@ -557,13 +557,13 @@ msgstr "More trade settings"
msgid "Insufficient cross-chain fees, need at least {0} {1}"
msgstr "Insufficient cross-chain fees, need at least {0} {1}"

#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:221
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:276
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:222
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:277
#: src/widgets/PoolWidget/PoolList/components/LoadingCard.tsx:77
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:197
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:298
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:254
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:394
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:198
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:299
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:255
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:395
msgid "TVL"
msgstr "TVL"

Expand Down Expand Up @@ -780,7 +780,7 @@ msgstr "Owner"
msgid "The pegged exchange rate refers to the exchange rate between two token assets where one's value is pegged/fixed by the other. For example, the pegged exchange rate between the US Dollar and USDT is 1."
msgstr "The pegged exchange rate refers to the exchange rate between two token assets where one's value is pegged/fixed by the other. For example, the pegged exchange rate between the US Dollar and USDT is 1."

#: src/components/Swap/components/SwapSettingsDialog/index.tsx:179
#: src/components/Swap/components/SwapSettingsDialog/index.tsx:177
msgid "Disable Indirect Routing"
msgstr "Disable Indirect Routing"

Expand Down Expand Up @@ -990,10 +990,10 @@ msgstr "Staked"
msgid "Start Time"
msgstr "Start Time"

#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:152
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:412
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:185
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:624
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:153
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:413
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:186
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:625
#: src/widgets/PoolWidget/PoolOperate/hooks/usePoolOrMiningTabs.ts:20
msgid "Mining"
msgstr "Mining"
Expand Down Expand Up @@ -1113,7 +1113,7 @@ msgstr "Single-Token Stake Mining"
msgid "Suitable for most situations."
msgstr "Suitable for most situations."

#: src/components/List/FailedList.tsx:42
#: src/components/List/FailedList.tsx:47
msgid "Something went wrong…<0>Refresh again</0>"
msgstr "Something went wrong…<0>Refresh again</0>"

Expand Down Expand Up @@ -1148,11 +1148,11 @@ msgstr "Swap Detail"
msgid "No ForceStop access"
msgstr "No ForceStop access"

#: src/components/Swap/components/SwapSettingsDialog/index.tsx:182
#: src/components/Swap/components/SwapSettingsDialog/index.tsx:180
msgid "Checking this option means that the routing algorithm will only route to liquidity pools between the two tokens in the trading pair and will ignore routes with any intermediary tokens."
msgstr "Checking this option means that the routing algorithm will only route to liquidity pools between the two tokens in the trading pair and will ignore routes with any intermediary tokens."

#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:172
#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:175
#: src/widgets/PoolWidget/PoolCreate/components/FeeRateCard.tsx:57
#: src/widgets/PoolWidget/PoolCreate/components/StepTitle.tsx:30
#: src/widgets/PoolWidget/PoolCreate/components/StepTitle.tsx:38
Expand All @@ -1170,8 +1170,8 @@ msgid "You are making changes to the liquidity of a private pool. This is a high
msgstr "You are making changes to the liquidity of a private pool. This is a highly discretionary operation that may cause substantial inflows/outflows of funds and changes in market prices. Please make sure you are fully aware of the implications of each parameter modification."

#: src/widgets/PoolWidget/PoolList/hooks/usePoolListTabs.ts:26
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:325
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:397
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:326
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:398
#: src/widgets/PoolWidget/PoolOperate/components/LiquidityInfo.tsx:357
msgid "My Liquidity"
msgstr "My Liquidity"
Expand Down Expand Up @@ -1350,22 +1350,22 @@ msgstr "Select Token Pair"
msgid "I have read, understand, and agree to the <0>Terms of Service</0>."
msgstr "I have read, understand, and agree to the <0>Terms of Service</0>."

#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:84
#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:86
msgid "Modify Confirmation"
msgstr "Modify Confirmation"

#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:102
#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:105
msgid "Version"
msgstr "Version"

#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:175
#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:178
#: src/widgets/PoolWidget/PoolCreate/components/LqRatioSet.tsx:87
msgid "Initial asset ratio"
msgstr "Initial asset ratio"

#: src/widgets/PoolWidget/PoolDetail/components/TitleInfo.tsx:115
#: src/widgets/PoolWidget/PoolDetail/index.tsx:184
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:449
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:450
#: src/widgets/PoolWidget/PoolModify/operate-widgets/FeeRateSetting.tsx:84
msgid "Edit"
msgstr "Edit"
Expand All @@ -1374,7 +1374,7 @@ msgstr "Edit"
msgid "Min"
msgstr "Min"

#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:658
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:659
msgid "Hide TVL=0 pools"
msgstr "Hide TVL=0 pools"

Expand Down Expand Up @@ -1439,8 +1439,8 @@ msgstr "Estimated transaction time"
msgid "Connect to your wallet"
msgstr "Connect to your wallet"

#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:226
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:301
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:227
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:302
msgid "Total Fee Revenue"
msgstr "Total Fee Revenue"

Expand All @@ -1456,7 +1456,7 @@ msgstr "Next"
#: src/widgets/MiningWidget/MiningCreate/operate-widgets/BottomButtonGroup.tsx:174
#: src/widgets/MiningWidget/MiningCreate/operate-widgets/BottomButtonGroup.tsx:185
#: src/widgets/MiningWidget/MiningCreate/operate-widgets/BottomButtonGroup.tsx:353
#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:194
#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:197
#: src/widgets/PoolWidget/PoolCreate/operate-widgets/BottomButtonGroup.tsx:85
msgid "Create"
msgstr "Create"
Expand Down Expand Up @@ -1582,12 +1582,12 @@ msgstr "My Staked"

#: src/widgets/MiningWidget/MiningCreate/operate-widgets/RewardForm.tsx:455
#: src/widgets/PoolWidget/PoolDetail/index.tsx:202
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:240
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:473
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:267
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:552
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:365
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:705
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:241
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:474
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:268
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:553
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:366
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:706
#: src/widgets/PoolWidget/PoolOperate/AddPoolOperate.tsx:89
#: src/widgets/PoolWidget/PoolOperate/hooks/usePoolOperateTabs.ts:15
msgid "Add"
Expand Down Expand Up @@ -1719,12 +1719,12 @@ msgid "Detail"
msgstr "Detail"

#: src/widgets/PoolWidget/PoolDetail/components/TitleInfo.tsx:194
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:183
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:279
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:184
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:280
#: src/widgets/PoolWidget/PoolList/components/LoadingCard.tsx:57
#: src/widgets/PoolWidget/PoolList/components/TokenListPoolItem.tsx:102
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:216
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:400
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:217
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:401
msgid "APY"
msgstr "APY"

Expand All @@ -1748,7 +1748,7 @@ msgid "Total Liquidity"
msgstr "Total Liquidity"

#: src/widgets/PoolWidget/PoolCreate/components/BaseInfoCardList.tsx:55
#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:146
#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:149
#: src/widgets/PoolWidget/PoolCreate/components/LqSettingsShow.tsx:139
#: src/widgets/PoolWidget/PoolCreate/operate-widgets/SlippageCoefficientSetting.tsx:68
#: src/widgets/PoolWidget/PoolCreate/operate-widgets/SlippageCoefficientSetting.tsx:135
Expand All @@ -1765,10 +1765,10 @@ msgid "Initial Price Alert"
msgstr "Initial Price Alert"

#: src/widgets/PoolWidget/PoolDetail/index.tsx:195
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:252
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:540
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:350
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:693
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:253
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:541
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:351
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:694
#: src/widgets/PoolWidget/PoolOperate/hooks/usePoolOperateTabs.ts:16
#: src/widgets/PoolWidget/PoolOperate/RemovePoolOperate.tsx:164
msgid "Remove"
Expand All @@ -1787,7 +1787,7 @@ msgstr "Cross Chain Summary"
msgid "SafeERC20: low-level call failed. Please contact the DODO team."
msgstr "SafeERC20: low-level call failed. Please contact the DODO team."

#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:84
#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:86
msgid "Pool Creation Confirmation"
msgstr "Pool Creation Confirmation"

Expand Down
Loading

0 comments on commit 1f7d016

Please sign in to comment.