Skip to content

Commit

Permalink
fix: swap deadline expired && change pool style
Browse files Browse the repository at this point in the history
  • Loading branch information
junjieit committed Dec 5, 2024
1 parent ffd21e3 commit 98ed4c3
Show file tree
Hide file tree
Showing 14 changed files with 126 additions and 80 deletions.
2 changes: 1 addition & 1 deletion 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.1-taiko.10",
"version": "3.0.1-taiko.11",
"description": "DODO Widgets",
"source": "src/index.tsx",
"types": "dist/types/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/dodoex-widgets/src/hooks/Swap/useFetchRoutePrice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export function useFetchRoutePrice({
Number(state.disableIndirectRouting),
);
const lastId = useRef(0);
const apiDdl = useMemo(() => Math.floor(Date.now() / 1000) + ddl * 60, [ddl]);
const [status, setStatus] = useState<RoutePriceStatus>(
RoutePriceStatus.Initial,
);
Expand Down Expand Up @@ -103,6 +102,7 @@ export function useFetchRoutePrice({
setStatus(RoutePriceStatus.Loading);
// waiting for set auto slippage
if (slippageLoading) return;
const apiDdl = Math.floor(Date.now() / 1000) + ddl * 60;
const params: any = {
chainId,
deadLine: apiDdl,
Expand Down Expand Up @@ -150,7 +150,7 @@ export function useFetchRoutePrice({
console.error(error);
}
}, [
apiDdl,
ddl,
account,
chainId,
toToken,
Expand Down
2 changes: 1 addition & 1 deletion packages/dodoex-widgets/src/locales/en-US.js

Large diffs are not rendered by default.

66 changes: 33 additions & 33 deletions packages/dodoex-widgets/src/locales/en-US.po
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ msgstr "Receive {0}"
msgid "{0} pending"
msgstr "{0} pending"

#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:445
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:446
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:342
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:705
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:706
msgid "Removing"
msgstr "Removing"

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

#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:247
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:388
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:389
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:287
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:595
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:596
msgid "Pool Type"
msgstr "Pool Type"

Expand All @@ -139,9 +139,9 @@ msgstr "Pool Type"
msgid "Unstaking"
msgstr "Unstaking"

#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:448
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:449
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:345
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:708
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:709
msgid "Adding"
msgstr "Adding"

Expand Down Expand Up @@ -294,10 +294,6 @@ msgstr "Edit Parameter Settings"
msgid "Hour"
msgstr "Hour"

#: src/widgets/PoolWidget/AMMV2Create/FeeEdit.tsx:233
msgid "The fee tier is too low. Please enter a value greater than {0}%."
msgstr "The fee tier is too low. Please enter a value greater than {0}%."

#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:169
#: src/widgets/PoolWidget/PoolCreate/components/StepTitle.tsx:28
#: src/widgets/PoolWidget/PoolCreate/index.tsx:305
Expand Down Expand Up @@ -457,9 +453,9 @@ msgstr "Amount of token rewards"
msgid "No results found"
msgstr "No results found"

#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:384
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:385
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:296
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:591
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:592
msgid "Pair"
msgstr "Pair"

Expand Down Expand Up @@ -672,12 +668,12 @@ 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:300
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:392
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:393
#: src/widgets/PoolWidget/PoolList/components/LoadingCard.tsx:77
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:198
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:299
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:342
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:600
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:601
msgid "TVL"
msgstr "TVL"

Expand Down Expand Up @@ -903,6 +899,10 @@ msgstr "Suitable for stablecoins with price fluctuations within 0.5%"
msgid "The slippage coefficient needs to be greater than 0, and less than 0.1."
msgstr "The slippage coefficient needs to be greater than 0, and less than 0.1."

#: src/widgets/PoolWidget/AMMV2Create/FeeEdit.tsx:233
msgid "The fee tier should greater than {0}%"
msgstr "The fee tier should greater than {0}%"

#: src/components/RiskDialog.tsx:19
msgid "Risk Disclaimer"
msgstr "Risk Disclaimer"
Expand Down Expand Up @@ -993,9 +993,9 @@ msgid "No LP pools match your criteria"
msgstr "No LP pools match your criteria"

#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:217
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:544
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:554
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:257
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:799
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:809
msgid "Fee rate"
msgstr "Fee rate"

Expand Down Expand Up @@ -1091,7 +1091,7 @@ msgid "Price impact reaches <0>{priceImpact}</0>%, accept the quote"
msgstr "Price impact reaches <0>{priceImpact}</0>%, accept the quote"

#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:321
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:399
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:400
msgid "Volume (1D)"
msgstr "Volume (1D)"

Expand Down Expand Up @@ -1189,9 +1189,9 @@ msgid "Start Time"
msgstr "Start Time"

#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:173
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:594
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:604
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:213
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:853
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:863
#: src/widgets/PoolWidget/PoolOperate/hooks/usePoolOrMiningTabs.ts:20
msgid "Mining"
msgstr "Mining"
Expand Down Expand Up @@ -1369,7 +1369,7 @@ 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/MyLiquidity.tsx:514
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:614
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:615
msgid "Price Range"
msgstr "Price Range"

Expand All @@ -1382,7 +1382,7 @@ msgstr "{0} deposited"
#: src/widgets/PoolWidget/AMMV3/components/PositionAmountPreview.tsx:222
#: src/widgets/PoolWidget/PoolList/hooks/usePoolListTabs.ts:28
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:451
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:609
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:610
#: src/widgets/PoolWidget/PoolOperate/components/LiquidityInfo.tsx:430
msgid "My Liquidity"
msgstr "My Liquidity"
Expand Down Expand Up @@ -1620,7 +1620,7 @@ msgstr "V2 & PMM"
#: src/widgets/PoolWidget/AMMV3/components/FeeSelector.tsx:60
#: src/widgets/PoolWidget/PoolDetail/components/TitleInfo.tsx:146
#: src/widgets/PoolWidget/PoolDetail/index.tsx:187
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:450
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:459
#: src/widgets/PoolWidget/PoolModify/operate-widgets/FeeRateSetting.tsx:84
msgid "Edit"
msgstr "Edit"
Expand All @@ -1629,7 +1629,7 @@ msgstr "Edit"
msgid "Min"
msgstr "Min"

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

Expand Down Expand Up @@ -1873,10 +1873,10 @@ msgstr "My Staked"
#: src/widgets/PoolWidget/AMMV3/components/ReviewModal.tsx:73
#: src/widgets/PoolWidget/PoolDetail/index.tsx:205
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:345
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:666
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:676
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:268
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:553
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:1071
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:562
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:1100
#: src/widgets/PoolWidget/PoolOperate/AddPoolOperate.tsx:106
#: src/widgets/PoolWidget/PoolOperate/hooks/usePoolOperateTabs.ts:15
msgid "Add"
Expand Down Expand Up @@ -1950,7 +1950,7 @@ msgstr "Do not select non-standard ERC20 tokens as this may lead to unknown erro
msgid "Create Pool"
msgstr "Create Pool"

#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:701
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:702
msgid "Managing"
msgstr "Managing"

Expand Down Expand Up @@ -2048,11 +2048,11 @@ msgstr "Detail"

#: src/widgets/PoolWidget/PoolDetail/components/TitleInfo.tsx:225
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:270
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:395
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:396
#: src/widgets/PoolWidget/PoolList/components/LoadingCard.tsx:57
#: src/widgets/PoolWidget/PoolList/components/TokenListPoolItem.tsx:102
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:312
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:605
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:606
msgid "APY"
msgstr "APY"

Expand Down Expand Up @@ -2113,9 +2113,9 @@ msgstr "Initial Price Alert"
#: src/widgets/PoolWidget/AMMV3/components/RemoveButton.tsx:32
#: src/widgets/PoolWidget/PoolDetail/index.tsx:198
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:253
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:541
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:550
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:543
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:1059
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:1088
#: src/widgets/PoolWidget/PoolOperate/hooks/usePoolOperateTabs.ts:16
#: src/widgets/PoolWidget/PoolOperate/RemovePoolOperate.tsx:228
msgid "Remove"
Expand Down Expand Up @@ -2221,7 +2221,7 @@ msgid "This trading pair does not have enough historical data and has used the d
msgstr "This trading pair does not have enough historical data and has used the default dynamic slippage."

#: src/widgets/PoolWidget/AMMV3/components/PositionViewCard.tsx:248
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:1071
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:1100
msgid "Manage"
msgstr "Manage"

Expand Down Expand Up @@ -2269,7 +2269,7 @@ msgstr "ForceStop exception"
#: src/components/LoadMore.tsx:50
#: src/widgets/PoolWidget/PoolDetail/components/MoreDetail/LiquidityProvidersTable.tsx:222
#: src/widgets/PoolWidget/PoolDetail/components/MoreDetail/SwapsTable.tsx:317
#: src/widgets/PoolWidget/PoolList/components/LiquidityTable.tsx:100
#: src/widgets/PoolWidget/PoolList/components/LiquidityTable.tsx:101
msgid "Load more"
msgstr "Load more"

Expand Down
2 changes: 1 addition & 1 deletion packages/dodoex-widgets/src/locales/zh-CN.js

Large diffs are not rendered by default.

Loading

0 comments on commit 98ed4c3

Please sign in to comment.