From 8f2a99204b6212656fb8706645900c43b0f2b1d1 Mon Sep 17 00:00:00 2001 From: necklace Date: Wed, 2 Mar 2022 13:51:09 +0800 Subject: [PATCH] Added credit offer and liquidity operation history analysis. --- app/assets/locales/locale-en.json | 21 +- app/assets/locales/locale-zh.json | 21 +- app/components/Blockchain/OperationAnt.js | 269 ++++++++++++++++++++++ 3 files changed, 307 insertions(+), 4 deletions(-) diff --git a/app/assets/locales/locale-en.json b/app/assets/locales/locale-en.json index 0f300d714c..b4b19a464a 100644 --- a/app/assets/locales/locale-en.json +++ b/app/assets/locales/locale-en.json @@ -1809,7 +1809,18 @@ "witness_pay": "Withdrew witness pay to account", "witness_receive": "Received witness from witness", "witness_update": "{account} update its witness info", - "worker_create": "{account} created a worker proposal with daily pay of {pay}" + "worker_create": "{account} created a worker proposal with daily pay of {pay}", + "credit_offer_delete": "{account} deleted credit offer #{id}.", + "credit_deal_repay": "{account} repays {amount} to credit offer,fee: {fee}.", + "credit_offer_accept": "{account} borrows {amount} from credit offer.", + "credit_offer_update": "{account} update a credit offer #{id}.", + "credit_offer_create": "{account} create a credit offer of {amount},fee rate: {fee}.", + "credit_deal_expired": "{account} credit deal has expired.", + "liquidity_pool_create": "{account} create a liquidity pool: {asset_a}-{asset_b}.", + "liquidity_pool_delete": "{account} deleted a liquidity pool #{id}.", + "liquidity_pool_deposit": "{account} add liquidity #{id}. paid {amount_a} and {amount_b}. received {received}.", + "liquidity_pool_withdraw": "{account} remove liquidity #{id}. paid {amount_c}. received {amount_a} and {amount_b}.", + "liquidity_pool_exchange": "{account} seal the deal, paid {amount_a}, received {amount_b}." }, "page404": { "asset_not_found_subtitle": "That asset does not exist", @@ -2602,7 +2613,13 @@ "credit_offer_delete": "Delete credit offer", "credit_offer_update": "Update credit offer", "credit_offer_accept": "Accept credit offer", - "credit_deal_repay": "Repay credit deal" + "credit_deal_repay": "Repay credit deal", + "credit_deal_expired": "Credit deal expired", + "liquidity_pool_create": "Create liquidity pool", + "liquidity_pool_delete": "Delete liquidity pool", + "liquidity_pool_deposit": "Add liquidity", + "liquidity_pool_withdraw": "Remove liquidity", + "liquidity_pool_exchange": "Exchange liquidity" }, "vesting_balance_create": "created vesting balance of", "view_json": "Show raw json", diff --git a/app/assets/locales/locale-zh.json b/app/assets/locales/locale-zh.json index 8622171266..c0644a529a 100644 --- a/app/assets/locales/locale-zh.json +++ b/app/assets/locales/locale-zh.json @@ -1806,7 +1806,18 @@ "witness_pay": "将见证人收入提取到账户", "witness_receive": "已从见证人处获取见证", "witness_update": "{account} 更新了见证人信息", - "worker_create": "{account} 创建了工人预算提案,请求日付工资 {pay}" + "worker_create": "{account} 创建了工人预算提案,请求日付工资 {pay}", + "credit_offer_delete": "{account} 删除P2P抵押贷 #{id}。", + "credit_deal_repay": "{account} 归还 {amount} P2P抵押贷借款,手续费:{fee}。", + "credit_offer_accept": "{account} 从P2P抵押贷借款 {amount}。", + "credit_offer_update": "{account} 更新P2P抵押贷 #{id}。", + "credit_offer_create": "{account} 创建 {amount} 的P2P抵押贷,手续费率:{fee}。", + "credit_deal_expired": "{account} P2P抵押贷逾期。", + "liquidity_pool_create": "{account} 创建流动池:{asset_a}-{asset_b}。", + "liquidity_pool_delete": "{account} 删除流动池 #{id}。", + "liquidity_pool_deposit": "{account} 增加流动性 #{id}。实际支出 {amount_a}和 {amount_b}。获得 {received}流动性代币。", + "liquidity_pool_withdraw": "{account} 减少流动性 #{id}。实际支出 {amount_c}流动性代币。获得 {amount_a}和 {amount_b}。", + "liquidity_pool_exchange": "{account} 完成交易,支出 {amount_a},获得 {amount_b}。" }, "page404": { "asset_not_found_subtitle": "此资产不存在", @@ -2599,7 +2610,13 @@ "credit_offer_delete": "P2P抵押贷 删除", "credit_offer_update": "P2P抵押贷 更新", "credit_offer_accept": "P2P抵押贷 借款", - "credit_deal_repay": "P2P抵押贷 还款" + "credit_deal_repay": "P2P抵押贷 还款", + "credit_deal_expired": "P2P抵押贷 逾期", + "liquidity_pool_create": "创建流动池", + "liquidity_pool_delete": "删除流动池", + "liquidity_pool_deposit": "增加流动性", + "liquidity_pool_withdraw": "减少流动性", + "liquidity_pool_exchange": "流动性交易" }, "vesting_balance_create": "创建待解冻余额", "view_json": "显示原始 json", diff --git a/app/components/Blockchain/OperationAnt.js b/app/components/Blockchain/OperationAnt.js index 1f9415f2f4..101a122c90 100644 --- a/app/components/Blockchain/OperationAnt.js +++ b/app/components/Blockchain/OperationAnt.js @@ -1575,6 +1575,275 @@ class Operation { ); + break; + case "credit_offer_delete": + color = "cancel"; + column = ( + + ); + break; + case "credit_deal_repay": + color = "success"; + column = ( + + ); + break; + case "credit_offer_accept": + color = "success"; + column = ( + + ); + break; + case "credit_offer_update": + color = "warning"; + column = ( + + ); + break; + case "credit_offer_create": + color = "warning"; + let amount = { + asset_id: op[1].asset_type, + amount: op[1].balance + }; + column = ( + + ); + break; + case "credit_deal_expired": + color = "cancel"; + column = ( + + ); + break; + case "liquidity_pool_create": + color = "warning"; + column = ( + + ); + break; + case "liquidity_pool_delete": + color = "cancel"; + column = ( + + ); + break; + case "liquidity_pool_deposit": + color = "warning"; + column = ( + + ); + break; + case "liquidity_pool_withdraw": + color = "warning"; + column = ( + + ); + break; + case "liquidity_pool_exchange": + color = "success"; + column = ( + + ); break; default: console.log("unimplemented op '" + ops[op[0]] + "':", op);