Skip to content

Commit e6d6060

Browse files
committed
feat(neuron-ui): rename interest to compensation
1 parent 8e2d505 commit e6d6060

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ const DAORecord = ({
6464
})
6565
}, [daoData, depositOutPoint, blockNumber])
6666

67-
const interest = BigInt(withdraw || capacity) - BigInt(capacity)
67+
const compensation = BigInt(withdraw || capacity) - BigInt(capacity)
6868

6969
let ready = false
7070
let metaInfo = 'Ready'
7171
if (!depositOutPoint) {
7272
const duration = BigInt(tipBlockNumber) - BigInt(blockNumber)
73-
metaInfo = t('nervos-dao.interest-accumulated', {
73+
metaInfo = t('nervos-dao.compensation-accumulated', {
7474
blockNumber: localNumberFormatter(duration >= BigInt(0) ? duration : 0),
7575
})
7676
} else {
@@ -115,8 +115,8 @@ const DAORecord = ({
115115
<div className={`${styles.daoRecord} ${depositOutPoint ? styles.isClaim : ''}`}>
116116
<div className={styles.primaryInfo}>
117117
<div>
118-
{interest >= BigInt(0)
119-
? `${depositOutPoint ? '' : '~'}${shannonToCKBFormatter(interest.toString()).toString()} CKB`
118+
{compensation >= BigInt(0)
119+
? `${depositOutPoint ? '' : '~'}${shannonToCKBFormatter(compensation.toString()).toString()} CKB`
120120
: ''}
121121
</div>
122122
<div>{`${shannonToCKBFormatter(capacity)} CKB`}</div>
@@ -142,7 +142,7 @@ const DAORecord = ({
142142
</div>
143143
</div>
144144
<div className={styles.secondaryInfo}>
145-
<span>{`APY: ~${calculateAPY(interest.toString(), capacity, `${Date.now() - +timestamp}`)}%`}</span>
145+
<span>{`APY: ~${calculateAPY(compensation.toString(), capacity, `${Date.now() - +timestamp}`)}%`}</span>
146146
<span>{uniformTimeFormatter(+timestamp)}</span>
147147
<span>{metaInfo}</span>
148148
</div>

packages/neuron-ui/src/components/NervosDAO/WithdrawDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const WithdrawDialog = ({
9292
<span>{`${shannonToCKBFormatter(record.capacity)} CKB`}</span>
9393
</Text>
9494
<Text as="p" variant="large" block>
95-
<span>{`${t('nervos-dao.interest')}: `}</span>
95+
<span>{`${t('nervos-dao.compensation')}: `}</span>
9696
<span>
9797
{withdrawValue
9898
? `${shannonToCKBFormatter((BigInt(withdrawValue) - BigInt(record.capacity)).toString())} CKB`

packages/neuron-ui/src/locales/en.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,13 +325,13 @@
325325
"cancel": "Cancel",
326326
"proceed": "Proceed",
327327
"deposit-value": "Deposit",
328-
"interest": "Interest",
328+
"compensation": "Compensation",
329329
"notice-wait-time": "Notice: You need to wait {{epochs}} epochs {{blocks}} blocks(~{{days}} days) to claim the saving.",
330-
"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.",
330+
"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.",
331331
"deposited-action-label": "Withdraw",
332332
"withdrawing-action-label": "Claim",
333333
"minimal-fee-required": "The minimum deposit capacity is {{minimal}} CKB",
334-
"interest-accumulated": "{{blockNumber}} blocks interest accumulated",
334+
"compensation-accumulated": "{{blockNumber}} blocks compensation accumulated",
335335
"blocks-left": "{{epochs}} epochs {{blocks}} blocks left(~{{days}} days)",
336336
"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.",
337337
"insufficient-period-alert-title": "Insufficient Period",

packages/neuron-ui/src/locales/zh.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,13 +325,13 @@
325325
"cancel": "取消",
326326
"proceed": "继续",
327327
"deposit-value": "存款",
328-
"interest": "利息",
328+
"compensation": "锁定补贴",
329329
"notice-wait-time": "注意: 您需要等待 {{epochs}} epochs {{blocks}} 区块(~{{days}}天)完成最终取款。",
330-
"deposit-terms": "存入 NervosDAO 的资产中需要 102 CKB 作为存款凭证的存储,这部分 CKB 是无法产生利息的\nNervos DAO 是一个系统层面的去中心化底层设施。您在其中存款是十分安全的。\n根据 Nervos DAO 的协议, 您需要等待至少 180 个 epochs 才能取回您的存款。",
330+
"deposit-terms": "存入 NervosDAO 的资产中需要 102 CKB 作为存款凭证的存储,这部分 CKB 是无法产生锁定补贴的\nNervos DAO 是一个系统层面的去中心化底层设施。您在其中存款是十分安全的。\n根据 Nervos DAO 的协议, 您需要等待至少 180 个 epochs 才能取回您的存款。",
331331
"deposited-action-label": "结算",
332332
"withdrawing-action-label": "取款",
333333
"minimal-fee-required": "存入金额应不少于 {{minimal}} CKB",
334-
"interest-accumulated": "已累计 {{blockNumber}} 个块的利息",
334+
"compensation-accumulated": "已累计 {{blockNumber}} 个块的锁定补贴",
335335
"blocks-left": " 还需等待 {{epochs}} epochs {{blocks}} 个块(~{{days}} 天)",
336336
"withdraw-alert": "风险提示:距离 NervosDAO 规定的最近一个允许提现 epoch 仅剩下 {{epochs}} 个 epoch,存在提现交易拥堵无法上链从而导致只能在下一个提现周期(约 {{days}} 天)的风险",
337337
"insufficient-period-alert-title": "未达到要求周期",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const YEAR = 365 * 24 * 60 * 60 * 1000
22
const BASE = 10000000
33

4-
export default (interest: string, amount: string, duration: string) => {
5-
const v = (BigInt(interest) * BigInt(YEAR) * BigInt(BASE)) / (BigInt(amount) * BigInt(duration))
4+
export default (compensation: string, amount: string, duration: string) => {
5+
const v = (BigInt(compensation) * BigInt(YEAR) * BigInt(BASE)) / (BigInt(amount) * BigInt(duration))
66
return `${(Number(v) / (BASE / 100)).toFixed(2)}`
77
}

0 commit comments

Comments
 (0)