diff --git a/_raw/locales/en/messages.json b/_raw/locales/en/messages.json index e5da3e98294..16af0dece37 100644 --- a/_raw/locales/en/messages.json +++ b/_raw/locales/en/messages.json @@ -409,6 +409,16 @@ "empty": "Not found in any node", "reBroadcastBtn": "Re-broadcast", "title": "Found in the below memopools" + }, + "message": { + "broadcastSuccess": "Broadcasted", + "cancelSuccess": "Canceled" + }, + "gas": { + "noCost": "No Gas cost" + }, + "SkipNonceAlert": { + "alert": "Nonce #{{nonce}} skipped on {{chainName}} chain. This may cause pending transactions ahead. <1/> <2>Submit a tx <3/> on chain to resolve" } }, "signedText": { diff --git a/_raw/locales/zh_CN/messages.json b/_raw/locales/zh_CN/messages.json index 766120a2fc1..f4f6c423ded 100644 --- a/_raw/locales/zh_CN/messages.json +++ b/_raw/locales/zh_CN/messages.json @@ -623,16 +623,49 @@ "canceled": "已取消", "failed": "交易失败", "pending": "待完成", - "submitFailed": "提交失败" + "submitFailed": "提交失败", + "pendingBroadcast": "Pending: 等待广播", + "pendingBroadcasted": "Pending: 已广播", + "withdrawed": "已快捷取消" }, "tips": { "canNotCancel": "无法加速或取消:不是第一个待完成的交易", - "pendingDetail": "只会有一笔交易成功完成,而且一般是 Gas Price 最高的一笔交易将成功" + "pendingDetail": "只会有一笔交易成功完成,而且一般是 Gas Price 最高的一笔交易将成功", + "pendingBroadcastRetry": "广播失败,上次广播时间:{{pushAt}}", + "pendingBroadcastRetryBtn": "重新广播", + "pendingBroadcast": "已设置为省Gas广播模式,正在等链上Gas较低的时广播。最晚将在创建后{{deadline}}后广播。", + "pendingBroadcastBtn": "立即广播" }, "txType": { "cancel": "取消交易", "initial": "发起交易", "speedUp": "加速交易" + }, + "MempoolList": { + "empty": "未发现包含这笔交易的节点", + "reBroadcastBtn": "重新广播", + "title": "已在以下节点的memopool发现这笔交易" + }, + "message": { + "broadcastSuccess": "已广播", + "cancelSuccess": "已取消" + }, + "CancelTxPopup": { + "title": "取消交易", + "options": { + "quickCancel": { + "title": "快捷取消", + "desc": "不需要发起链上取消,不需要Gasfee", + "tips": "不是等待广播的交易,不支持快捷取消" + }, + "onChainCancel": { + "title": "链上取消", + "desc": "发起新的链上交易来取消,需要Gasfee" + } + } + }, + "SkipNonceAlert": { + "alert": "当前{{chainName}}链因快捷取消导致Nonce#{{nonce}}被跳过, 导致后续Pending交易无法完成, 可<1/><2>发起一笔链上交易<3/>来填充" } }, "title": "签名记录" diff --git a/src/ui/views/Approval/components/BroadcastMode/index.tsx b/src/ui/views/Approval/components/BroadcastMode/index.tsx index 92926d3f28a..9b428fba926 100644 --- a/src/ui/views/Approval/components/BroadcastMode/index.tsx +++ b/src/ui/views/Approval/components/BroadcastMode/index.tsx @@ -383,7 +383,7 @@ export const BroadcastMode = ({ }} >
-
+
{option.title}
{option.desc}
diff --git a/src/ui/views/TransactionHistory/components/SkipNonceAlert.tsx b/src/ui/views/TransactionHistory/components/SkipNonceAlert.tsx index 6a3bfaff3c8..774d4012091 100644 --- a/src/ui/views/TransactionHistory/components/SkipNonceAlert.tsx +++ b/src/ui/views/TransactionHistory/components/SkipNonceAlert.tsx @@ -9,6 +9,7 @@ import { ConnectedSite } from 'background/service/permission'; import { CHAINS, INTERNAL_REQUEST_ORIGIN } from 'consts'; import { flatten, maxBy } from 'lodash'; import React from 'react'; +import { Trans } from 'react-i18next'; import styled from 'styled-components'; import IconWarning from 'ui/assets/signature-record/warning.svg'; @@ -57,17 +58,25 @@ const AlertDetail = ({
- Nonce #{data.nonce} skipped on {chain?.name || 'Unkown'} chain. This may - cause pending transactions ahead.{' '} - { - onSubmitTx?.(data); + - Submit a tx - {' '} - on chain to resolve + Nonce #{data.nonce} skipped on {chain?.name || 'Unknown'} chain. This + may cause pending transactions ahead.{' '} + { + onSubmitTx?.(data); + }} + > + Submit a tx + {' '} + on chain to resolve +
); diff --git a/src/ui/views/TransactionHistory/components/TransactionItem.tsx b/src/ui/views/TransactionHistory/components/TransactionItem.tsx index 4f5d6ce8c39..227879fc1db 100644 --- a/src/ui/views/TransactionHistory/components/TransactionItem.tsx +++ b/src/ui/views/TransactionHistory/components/TransactionItem.tsx @@ -94,7 +94,7 @@ export const TransactionItem = ({ address: maxGasTx.rawTx.from, }); onQuickCancel?.(); - message.success('Canceled'); + message.success(t('page.activities.signedTx.message.cancelSuccess')); } catch (e) { message.error(e.message); } @@ -113,7 +113,7 @@ export const TransactionItem = ({ nonce: +tx.rawTx.nonce, address: tx.rawTx.from, }); - message.success('Broadcasted'); + message.success(t('page.activities.signedTx.message.broadcastSuccess')); } catch (e) { console.error(e); message.error(e.message); diff --git a/src/ui/views/TransactionHistory/components/TransactionPendingTag.tsx b/src/ui/views/TransactionHistory/components/TransactionPendingTag.tsx index ebc0eb62766..ed2eef5d402 100644 --- a/src/ui/views/TransactionHistory/components/TransactionPendingTag.tsx +++ b/src/ui/views/TransactionHistory/components/TransactionPendingTag.tsx @@ -32,6 +32,15 @@ export const TransactionPendingTag = ({ return null; } + if (maxGasTx.hash && !maxGasTx.reqId) { + return ( +
+ + {t('page.activities.signedTx.status.pending')} +
+ ); + } + if (maxGasTx.hash) { return ( {t('page.activities.signedTx.status.pendingBroadcast')}{' '} {t('page.activities.signedTx.tips.pendingBroadcastRetry', { @@ -96,9 +107,11 @@ export const TransactionPendingTag = ({ {t('page.activities.signedTx.status.pendingBroadcast')}{' '} {t('page.activities.signedTx.tips.pendingBroadcast', { diff --git a/src/ui/views/TransactionHistory/index.tsx b/src/ui/views/TransactionHistory/index.tsx index 094ba6e6772..5445af69fff 100644 --- a/src/ui/views/TransactionHistory/index.tsx +++ b/src/ui/views/TransactionHistory/index.tsx @@ -49,12 +49,6 @@ const TransactionHistory = () => { setCompleteList(completeds); }; - // useInterval(() => { - // if (pendingList.length > 0) { - // loadList(); - // } - // }, 5000); - const handleTxComplete = () => { init(); };