diff --git a/packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx b/packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx index 564aaf4764..f129370cf3 100644 --- a/packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx +++ b/packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx @@ -64,13 +64,13 @@ const DAORecord = ({ }) }, [daoData, depositOutPoint, blockNumber]) - const interest = BigInt(withdraw || capacity) - BigInt(capacity) + const compensation = BigInt(withdraw || capacity) - BigInt(capacity) let ready = false let metaInfo = 'Ready' if (!depositOutPoint) { const duration = BigInt(tipBlockNumber) - BigInt(blockNumber) - metaInfo = t('nervos-dao.interest-accumulated', { + metaInfo = t('nervos-dao.compensation-accumulated', { blockNumber: localNumberFormatter(duration >= BigInt(0) ? duration : 0), }) } else { @@ -115,8 +115,8 @@ const DAORecord = ({
- {interest >= BigInt(0) - ? `${depositOutPoint ? '' : '~'}${shannonToCKBFormatter(interest.toString()).toString()} CKB` + {compensation >= BigInt(0) + ? `${depositOutPoint ? '' : '~'}${shannonToCKBFormatter(compensation.toString()).toString()} CKB` : ''}
{`${shannonToCKBFormatter(capacity)} CKB`}
@@ -142,7 +142,7 @@ const DAORecord = ({
- {`APY: ~${calculateAPY(interest.toString(), capacity, `${Date.now() - +timestamp}`)}%`} + {`APY: ~${calculateAPY(compensation.toString(), capacity, `${Date.now() - +timestamp}`)}%`} {uniformTimeFormatter(+timestamp)} {metaInfo}
diff --git a/packages/neuron-ui/src/components/NervosDAO/WithdrawDialog.tsx b/packages/neuron-ui/src/components/NervosDAO/WithdrawDialog.tsx index 294da0d95a..01fce07c2d 100644 --- a/packages/neuron-ui/src/components/NervosDAO/WithdrawDialog.tsx +++ b/packages/neuron-ui/src/components/NervosDAO/WithdrawDialog.tsx @@ -92,7 +92,7 @@ const WithdrawDialog = ({ {`${shannonToCKBFormatter(record.capacity)} CKB`} - {`${t('nervos-dao.interest')}: `} + {`${t('nervos-dao.compensation')}: `} {withdrawValue ? `${shannonToCKBFormatter((BigInt(withdrawValue) - BigInt(record.capacity)).toString())} CKB` diff --git a/packages/neuron-ui/src/locales/en.json b/packages/neuron-ui/src/locales/en.json index e1c8db0a17..0cf35a730f 100644 --- a/packages/neuron-ui/src/locales/en.json +++ b/packages/neuron-ui/src/locales/en.json @@ -325,13 +325,13 @@ "cancel": "Cancel", "proceed": "Proceed", "deposit-value": "Deposit", - "interest": "Interest", + "compensation": "Compensation", "notice-wait-time": "Notice: You need to wait {{epochs}} epochs {{blocks}} blocks(~{{days}} days) to claim the saving.", - "deposit-terms": "Nervos DAO needs 102 CKB for receipt storage, which is not interest-bearing.\nNervos DAO is a system layer decentralized infrastructure. Your saving here is secure.\nAccording to the Nervos DAO protocol, you need at least 180 epochs to withdraw your deposit.", + "deposit-terms": "Nervos DAO needs 102 CKB for receipt storage, which is not compensation-bearing.\nNervos DAO is a system layer decentralized infrastructure. Your saving here is secure.\nAccording to the Nervos DAO protocol, you need at least 180 epochs to withdraw your deposit.", "deposited-action-label": "Withdraw", "withdrawing-action-label": "Claim", "minimal-fee-required": "The minimum deposit capacity is {{minimal}} CKB", - "interest-accumulated": "{{blockNumber}} blocks interest accumulated", + "compensation-accumulated": "{{blockNumber}} blocks compensation accumulated", "blocks-left": "{{epochs}} epochs {{blocks}} blocks left(~{{days}} days)", "withdraw-alert": "Alert: these are only {{epochs}} epochs left before the next start withdrawing epoch number conforming to Nervos DAO, and it is possible that you have to do the withdraw after the next period(~{{days}}) due to the jam on CKB.", "insufficient-period-alert-title": "Insufficient Period", diff --git a/packages/neuron-ui/src/locales/zh.json b/packages/neuron-ui/src/locales/zh.json index eea59d3f59..d216b8e6f7 100644 --- a/packages/neuron-ui/src/locales/zh.json +++ b/packages/neuron-ui/src/locales/zh.json @@ -325,13 +325,13 @@ "cancel": "取消", "proceed": "继续", "deposit-value": "存款", - "interest": "利息", + "compensation": "锁定补贴", "notice-wait-time": "注意: 您需要等待 {{epochs}} epochs {{blocks}} 区块(~{{days}}天)完成最终取款。", - "deposit-terms": "存入 NervosDAO 的资产中需要 102 CKB 作为存款凭证的存储,这部分 CKB 是无法产生利息的。\nNervos DAO 是一个系统层面的去中心化底层设施。您在其中存款是十分安全的。\n根据 Nervos DAO 的协议, 您需要等待至少 180 个 epochs 才能取回您的存款。", + "deposit-terms": "存入 NervosDAO 的资产中需要 102 CKB 作为存款凭证的存储,这部分 CKB 是无法产生锁定补贴的。\nNervos DAO 是一个系统层面的去中心化底层设施。您在其中存款是十分安全的。\n根据 Nervos DAO 的协议, 您需要等待至少 180 个 epochs 才能取回您的存款。", "deposited-action-label": "结算", "withdrawing-action-label": "取款", "minimal-fee-required": "存入金额应不少于 {{minimal}} CKB", - "interest-accumulated": "已累计 {{blockNumber}} 个块的利息", + "compensation-accumulated": "已累计 {{blockNumber}} 个块的锁定补贴", "blocks-left": " 还需等待 {{epochs}} epochs {{blocks}} 个块(~{{days}} 天)", "withdraw-alert": "风险提示:距离 NervosDAO 规定的最近一个允许提现 epoch 仅剩下 {{epochs}} 个 epoch,存在提现交易拥堵无法上链从而导致只能在下一个提现周期(约 {{days}} 天)的风险", "insufficient-period-alert-title": "未达到要求周期", diff --git a/packages/neuron-ui/src/utils/calculateAPY.ts b/packages/neuron-ui/src/utils/calculateAPY.ts index 0748ea8c8b..cae67e4206 100644 --- a/packages/neuron-ui/src/utils/calculateAPY.ts +++ b/packages/neuron-ui/src/utils/calculateAPY.ts @@ -1,7 +1,7 @@ const YEAR = 365 * 24 * 60 * 60 * 1000 const BASE = 10000000 -export default (interest: string, amount: string, duration: string) => { - const v = (BigInt(interest) * BigInt(YEAR) * BigInt(BASE)) / (BigInt(amount) * BigInt(duration)) +export default (compensation: string, amount: string, duration: string) => { + const v = (BigInt(compensation) * BigInt(YEAR) * BigInt(BASE)) / (BigInt(amount) * BigInt(duration)) return `${(Number(v) / (BASE / 100)).toFixed(2)}` }