Skip to content

Commit

Permalink
Merge pull request #3471 from xiangxn/feature-add-samet-fund-history
Browse files Browse the repository at this point in the history
add flash loan history
  • Loading branch information
sschiessl-bcp authored Mar 16, 2022
2 parents 0f5d5a0 + b0bd80c commit c19b2d9
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/assets/locales/locale-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1789,6 +1789,11 @@
"liquidity_pool_deposit": "{account} add liquidity #{id}. paid {amount_a} and {amount_b}. received {received}.",
"liquidity_pool_exchange": "{account} seal the deal, paid {amount_a}, received {amount_b}.",
"liquidity_pool_withdraw": "{account} remove liquidity #{id}. paid {amount_c}. received {amount_a} and {amount_b}.",
"samet_fund_create": "{account} creates a flash loan of {amount}, fee rate: {fee}.",
"samet_fund_update": "{account} update flash loan #{id}.",
"samet_fund_delete": "{account} delete flash loan #{id}, get back {amount}.",
"samet_fund_borrow": "{account} lent {amount} from flash loan #{id}.",
"samet_fund_repay": "{account} repays flash loan #{id} {amount}, fee: {fee}.",
"no_recent": "No recent transactions",
"override_transfer": "{issuer} transferred {amount} from {from} to {to}",
"pending": "pending %(blocks)s blocks",
Expand Down Expand Up @@ -2587,6 +2592,11 @@
"credit_offer_create": "Create credit offer",
"credit_offer_delete": "Delete credit offer",
"credit_offer_update": "Update credit offer",
"samet_fund_create": "Create flash loan",
"samet_fund_update": "Update flash loan",
"samet_fund_delete": "Delete flash loan",
"samet_fund_borrow": "Borrow flash loan",
"samet_fund_repay": "Repay flash loan",
"custom": "Custom",
"execute_bid": "Execute bid",
"fba_distribute": "Fee backed asset distribution",
Expand Down
10 changes: 10 additions & 0 deletions app/assets/locales/locale-zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -1789,6 +1789,11 @@
"liquidity_pool_deposit": "{account} 增加流动性 #{id}。实际支出 {amount_a}和 {amount_b}。获得 {received}流动性代币。",
"liquidity_pool_exchange": "{account} 完成交易,支出 {amount_a},获得 {amount_b}。",
"liquidity_pool_withdraw": "{account} 减少流动性 #{id}。实际支出 {amount_c}流动性代币。获得 {amount_a}和 {amount_b}。",
"samet_fund_create": "{account} 创建 {amount}的闪电贷,手续费率:{fee}。",
"samet_fund_update": "{account} 更新闪电贷 #{id}。",
"samet_fund_delete": "{account} 删除闪电贷 #{id},取回 {amount}。",
"samet_fund_borrow": "{account} 从闪电贷 #{id} 借出 {amount}。",
"samet_fund_repay": "{account} 偿还闪电贷 #{id} {amount},手续费:{fee}。",
"no_recent": "近期无交易",
"override_transfer": "{issuer} 从 {from} 将 {amount} 转账给 {to}",
"pending": " %(blocks)s 个区块待定",
Expand Down Expand Up @@ -2587,6 +2592,11 @@
"credit_offer_create": "P2P抵押贷 创建",
"credit_offer_delete": "P2P抵押贷 删除",
"credit_offer_update": "P2P抵押贷 更新",
"samet_fund_create": "创建闪电贷",
"samet_fund_update": "更新闪电贷",
"samet_fund_delete": "删除闪电贷",
"samet_fund_borrow": "借出闪电贷",
"samet_fund_repay": "偿还闪电贷",
"custom": "自定义",
"execute_bid": "执行竞价",
"fba_distribute": "手续费由担保资产分配",
Expand Down
125 changes: 125 additions & 0 deletions app/components/Blockchain/OperationAnt.js
Original file line number Diff line number Diff line change
Expand Up @@ -1845,6 +1845,131 @@ class Operation {
/>
);
break;
case "samet_fund_create":
color = "warning";
column = (
<TranslateWithLinks
string="operation.samet_fund_create"
keys={[
{
type: "account",
value: op[1].owner_account,
arg: "account"
},
{
type: "amount",
value: {
asset_id: op[1].asset_type,
amount: op[1].balance
},
arg: "amount"
},
{
value: `${(parseFloat(op[1].fee_rate) /
1000000) *
100}%`,
arg: "fee"
}
]}
/>
);
break;
case "samet_fund_update":
color = "warning";
column = (
<TranslateWithLinks
string="operation.samet_fund_update"
keys={[
{
type: "account",
value: op[1].owner_account,
arg: "account"
},
{
value: op[1].fund_id,
arg: "id"
}
]}
/>
);
break;
case "samet_fund_delete":
color = "cancel";
column = (
<TranslateWithLinks
string="operation.samet_fund_delete"
keys={[
{
type: "account",
value: op[1].owner_account,
arg: "account"
},
{
value: op[1].fund_id,
arg: "id"
},
{
type: "amount",
value: result[1],
arg: "amount"
}
]}
/>
);
break;
case "samet_fund_borrow":
color = "success";
column = (
<TranslateWithLinks
string="operation.samet_fund_borrow"
keys={[
{
type: "account",
value: op[1].borrower,
arg: "account"
},
{
value: op[1].fund_id,
arg: "id"
},
{
type: "amount",
value: op[1].borrow_amount,
arg: "amount"
}
]}
/>
);
break;
case "samet_fund_repay":
color = "success";
column = (
<TranslateWithLinks
string="operation.samet_fund_repay"
keys={[
{
type: "account",
value: op[1].account,
arg: "account"
},
{
value: op[1].fund_id,
arg: "id"
},
{
type: "amount",
value: op[1].repay_amount,
arg: "amount"
},
{
type: "amount",
value: op[1].fund_fee,
arg: "fee"
}
]}
/>
);
break;
default:
console.log("unimplemented op '" + ops[op[0]] + "':", op);
column = (
Expand Down

0 comments on commit c19b2d9

Please sign in to comment.