From 89d0b4740304829700e4f066f9b5a73738013e78 Mon Sep 17 00:00:00 2001 From: vkrasutsky Date: Fri, 15 Nov 2019 10:03:45 +0300 Subject: [PATCH] [BLP-481] Echo 0.13 (#57) * [BLP-481] echo 0.13 * [BLP-481] Echo 0.13 * [BLP-481] Echo 0.13 * [BLP-481] Echo 0.13 --- app/actions/transaction-actions.js | 2 + app/constants/transaction-constants.js | 379 ++++++++++++++++--------- app/translations/en.json | 35 +++ app/translations/ru.json | 53 +++- 4 files changed, 322 insertions(+), 147 deletions(-) diff --git a/app/actions/transaction-actions.js b/app/actions/transaction-actions.js index a626997..bd0fe6c 100644 --- a/app/actions/transaction-actions.js +++ b/app/actions/transaction-actions.js @@ -129,6 +129,7 @@ export const formatTransaction = async (type, operation, blockNumber, resultId, } options = Object.entries(options).map(async ([key, value]) => { + if (!value) { return value; } let response; @@ -422,6 +423,7 @@ const updateFilters = (filter) => async (dispatch, getState) => { dispatch(setIn('history', { filter })); saveHistoryFilter(filter); + }; /** diff --git a/app/constants/transaction-constants.js b/app/constants/transaction-constants.js index 2ac3f09..661674b 100644 --- a/app/constants/transaction-constants.js +++ b/app/constants/transaction-constants.js @@ -20,7 +20,6 @@ export const OPTION_TYPES = { export const CONTRACT_TYPES = [ OPERATIONS_IDS.CONTRACT_CREATE, OPERATIONS_IDS.CONTRACT_CALL, - OPERATIONS_IDS.CONTRACT_TRANSFER, ]; export const ACCOUNT_TYPES = [ @@ -63,6 +62,54 @@ export const OPERATIONS = { }, }, }, + transfer_to_address: { + value: OPERATIONS_IDS.TRANSFER_TO_ADDRESS, + name: 'operations.transfer_to_address.title', + options: { + from: { + field: 'from', + type: OPTION_TYPES.ACCOUNT, + label: 'operations.transfer_to_address.from', + }, + subject: { + field: 'to', + type: OPTION_TYPES.ACCOUNT_ADDRESS, + label: 'operations.transfer_to_address.subject', + }, + amount: { + field: 'amount.amount', + type: OPTION_TYPES.NUMBER, + }, + asset: { + field: 'amount.asset_id', + type: OPTION_TYPES.ASSET, + }, + }, + }, + override_transfer: { + value: OPERATIONS_IDS.OVERRIDE_TRANSFER, + name: 'operations.override_transfer.title', + options: { + from: { + field: 'from', + type: OPTION_TYPES.ACCOUNT, + label: 'operations.override_transfer.from', + }, + subject: { + field: 'to', + type: OPTION_TYPES.ACCOUNT, + label: 'operations.override_transfer.subject', + }, + amount: { + field: 'amount.amount', + type: OPTION_TYPES.NUMBER, + }, + asset: { + field: 'amount.asset_id', + type: OPTION_TYPES.ASSET, + }, + }, + }, account_create: { value: OPERATIONS_IDS.ACCOUNT_CREATE, name: 'operations.account_create.title', @@ -113,6 +160,20 @@ export const OPERATIONS = { asset: null, }, }, + account_address_create: { + value: OPERATIONS_IDS.ACCOUNT_ADDRESS_CREATE, + name: 'operations.account_address_create.title', + options: { + from: { + field: 'owner', + type: OPTION_TYPES.ACCOUNT, + label: 'operations.account_address_create.from', + }, + subject: null, + amount: null, + asset: null, + }, + }, asset_create: { value: OPERATIONS_IDS.ASSET_CREATE, name: 'operations.asset_create.title', @@ -273,6 +334,26 @@ export const OPERATIONS = { }, }, }, + asset_claim_fees: { + value: OPERATIONS_IDS.ASSET_CLAIM_FEES, + name: 'operations.asset_claim_fees.title', + options: { + from: { + field: 'issuer', + type: OPTION_TYPES.ACCOUNT, + label: 'operations.asset_claim_fees.from', + }, + subject: null, + amount: { + field: 'amount_to_claim.amount', + type: OPTION_TYPES.NUMBER, + }, + asset: { + field: 'amount_to_claim.asset_id', + type: OPTION_TYPES.ASSET, + }, + }, + }, proposal_create: { value: OPERATIONS_IDS.PROPOSAL_CREATE, name: 'operations.proposal_create.title', @@ -353,6 +434,66 @@ export const OPERATIONS = { asset: null, }, }, + committee_member_activate: { + value: OPERATIONS_IDS.COMMITTEE_MEMBER_ACTIVATE, + name: 'operations.committee_member_activate.title', + options: { + from: null, + subject: null, + amount: null, + asset: null, + }, + }, + committee_member_deactivate: { + value: OPERATIONS_IDS.COMMITTEE_MEMBER_DEACTIVATE, + name: 'operations.committee_member_deactivate.title', + options: { + from: null, + subject: null, + amount: null, + asset: null, + }, + }, + committee_frozen_balance_deposit: { + value: OPERATIONS_IDS.COMMITTEE_FROZEN_BALANCE_DEPOSIT, + name: 'operations.committee_frozen_balance_deposit.title', + options: { + from: { + field: 'committee_member_account', + type: OPTION_TYPES.ACCOUNT, + label: 'operations.committee_frozen_balance_deposit.from', + }, + subject: null, + amount: { + field: 'amount.amount', + type: OPTION_TYPES.NUMBER, + }, + asset: { + field: 'amount.asset_id', + type: OPTION_TYPES.ASSET, + }, + }, + }, + committee_frozen_balance_withdraw: { + value: OPERATIONS_IDS.COMMITTEE_FROZEN_BALANCE_WITHDRAW, + name: 'operations.committee_frozen_balance_withdraw.title', + options: { + from: { + field: 'committee_member_account', + type: OPTION_TYPES.ACCOUNT, + label: 'operations.committee_frozen_balance_withdraw.from', + }, + subject: null, + amount: { + field: 'amount.amount', + type: OPTION_TYPES.NUMBER, + }, + asset: { + field: 'amount.asset_id', + type: OPTION_TYPES.ASSET, + }, + }, + }, vesting_balance_create: { value: OPERATIONS_IDS.VESTING_BALANCE_CREATE, name: 'operations.vesting_balance_create.title', @@ -451,58 +592,58 @@ export const OPERATIONS = { }, }, }, - override_transfer: { - value: OPERATIONS_IDS.OVERRIDE_TRANSFER, - name: 'operations.override_transfer.title', + contract_create: { + value: OPERATIONS_IDS.CONTRACT_CREATE, + name: 'operations.contract_create.title', options: { from: { - field: 'from', - type: OPTION_TYPES.ACCOUNT, - label: 'operations.override_transfer.from', - }, - subject: { - field: 'to', + field: 'registrar', type: OPTION_TYPES.ACCOUNT, - label: 'operations.override_transfer.subject', + label: 'operations.contract_create.from', }, + subject: null, amount: { - field: 'amount.amount', + field: 'value.amount', type: OPTION_TYPES.NUMBER, }, asset: { - field: 'amount.asset_id', + field: 'value.asset_id', type: OPTION_TYPES.ASSET, }, }, }, - asset_claim_fees: { - value: OPERATIONS_IDS.ASSET_CLAIM_FEES, - name: 'operations.asset_claim_fees.title', + contract_call: { + value: OPERATIONS_IDS.CONTRACT_CALL, + name: 'operations.contract_call.title', options: { from: { - field: 'issuer', + field: 'registrar', type: OPTION_TYPES.ACCOUNT, - label: 'operations.asset_claim_fees.from', + label: 'operations.contract_call.from', + }, + subject: { + field: 'callee', + type: OPTION_TYPES.CONTRACT, + label: 'operations.contract_call.subject', }, - subject: null, amount: { - field: 'amount_to_claim.amount', + field: 'value.amount', type: OPTION_TYPES.NUMBER, }, asset: { - field: 'amount_to_claim.asset_id', + field: 'value.asset_id', type: OPTION_TYPES.ASSET, }, }, }, - contract_create: { - value: OPERATIONS_IDS.CONTRACT_CREATE, - name: 'operations.contract_create.title', + contract_internal_create: { + value: OPERATIONS_IDS.CONTRACT_INTERNAL_CREATE, + name: 'operations.contract_internal_create.title', options: { from: { - field: 'registrar', - type: OPTION_TYPES.ACCOUNT, - label: 'operations.contract_create.from', + field: 'caller', + type: OPTION_TYPES.CONTRACT, + label: 'operations.contract_internal_create.from', }, subject: null, amount: { @@ -515,20 +656,16 @@ export const OPERATIONS = { }, }, }, - contract_call: { - value: OPERATIONS_IDS.CONTRACT_CALL, - name: 'operations.contract_call.title', + contract_internal_call: { + value: OPERATIONS_IDS.CONTRACT_INTERNAL_CALL, + name: 'operations.contract_internal_call.title', options: { from: { - field: 'registrar', - type: OPTION_TYPES.ACCOUNT, - label: 'operations.contract_call.from', - }, - subject: { - field: 'callee', + field: 'caller', type: OPTION_TYPES.CONTRACT, - label: 'operations.contract_call.subject', + label: 'operations.contract_internal_call.from', }, + subject: null, amount: { field: 'value.amount', type: OPTION_TYPES.NUMBER, @@ -539,28 +676,18 @@ export const OPERATIONS = { }, }, }, - contract_transfer: { - value: OPERATIONS_IDS.CONTRACT_TRANSFER, - name: 'operations.contract_transfer.title', + contract_selfdestruct: { + value: OPERATIONS_IDS.CONTRACT_SELFDESTRUCT, + name: 'operations.contract_selfdestruct.title', options: { from: { - field: 'from', - type: OPTION_TYPES.ACCOUNT, - label: 'operations.contract_transfer.from', - }, - subject: { - field: 'to', - type: OPTION_TYPES.ACCOUNT, - label: 'operations.contract_transfer.subject', - }, - amount: { - field: 'amount.amount', - type: OPTION_TYPES.NUMBER, - }, - asset: { - field: 'amount.asset_id', - type: OPTION_TYPES.ASSET, + field: 'contract', + type: OPTION_TYPES.CONTRACT, + label: 'operations.contract_selfdestruct.from', }, + subject: null, + value: null, + asset: null, }, }, contract_update: { @@ -581,44 +708,48 @@ export const OPERATIONS = { asset: null, }, }, - account_address_create: { - value: OPERATIONS_IDS.ACCOUNT_ADDRESS_CREATE, - name: 'operations.account_address_create.title', - options: { - from: { - field: 'owner', - type: OPTION_TYPES.ACCOUNT, - label: 'operations.account_address_create.from', - }, - subject: null, - amount: null, - asset: null, - }, - }, - transfer_to_address: { - value: OPERATIONS_IDS.TRANSFER_TO_ADDRESS, - name: 'operations.transfer_to_address.title', + contract_fund_pool: { + value: OPERATIONS_IDS.CONTRACT_FUND_POOL, + name: 'operations.contract_fund_pool.title', options: { from: { - field: 'from', + field: 'sender', type: OPTION_TYPES.ACCOUNT, - label: 'operations.transfer_to_address.from', + label: 'operations.contract_fund_pool.from', }, subject: { - field: 'to', - type: OPTION_TYPES.ACCOUNT_ADDRESS, - label: 'operations.transfer_to_address.subject', + field: 'contract', + type: OPTION_TYPES.CONTRACT, + label: 'operations.contract_fund_pool.subject', }, amount: { - field: 'amount.amount', + field: 'value.amount', type: OPTION_TYPES.NUMBER, }, asset: { - field: 'amount.asset_id', + field: 'value.asset_id', type: OPTION_TYPES.ASSET, }, }, }, + contract_whitelist: { + value: OPERATIONS_IDS.CONTRACT_WHITELIST, + name: 'operations.contract_whitelist.title', + options: { + from: { + field: 'sender', + type: OPTION_TYPES.ACCOUNT, + label: 'operations.contract_whitelist.from', + }, + subject: { + field: 'contract', + type: OPTION_TYPES.CONTRACT, + label: 'operations.contract_whitelist.subject', + }, + amount: null, + asset: null, + }, + }, sidechain_eth_create_address: { value: OPERATIONS_IDS.SIDECHAIN_ETH_CREATE_ADDRESS, name: 'operations.sidechain_eth_create_address.title', @@ -711,48 +842,6 @@ export const OPERATIONS = { asset: null, }, }, - contract_fund_pool: { - value: OPERATIONS_IDS.CONTRACT_FUND_POOL, - name: 'operations.contract_fund_pool.title', - options: { - from: { - field: 'sender', - type: OPTION_TYPES.ACCOUNT, - label: 'operations.contract_fund_pool.from', - }, - subject: { - field: 'contract', - type: OPTION_TYPES.CONTRACT, - label: 'operations.contract_fund_pool.subject', - }, - amount: { - field: 'value.amount', - type: OPTION_TYPES.NUMBER, - }, - asset: { - field: 'value.asset_id', - type: OPTION_TYPES.ASSET, - }, - }, - }, - contract_whitelist: { - value: OPERATIONS_IDS.CONTRACT_WHITELIST, - name: 'operations.contract_whitelist.title', - options: { - from: { - field: 'sender', - type: OPTION_TYPES.ACCOUNT, - label: 'operations.contract_whitelist.from', - }, - subject: { - field: 'contract', - type: OPTION_TYPES.CONTRACT, - label: 'operations.contract_whitelist.subject', - }, - amount: null, - asset: null, - }, - }, sidechain_issue: { value: OPERATIONS_IDS.SIDECHAIN_ISSUE, name: 'operations.sidechain_issue.title', @@ -944,6 +1033,20 @@ export const OPERATIONS = { asset: null, }, }, + sidechain_btc_create_intermediate_deposit: { + value: OPERATIONS_IDS.SIDECHAIN_BTC_CREATE_INTERMEDIATE_DEPOSIT, + name: 'operations.sidechain_btc_create_intermediate_deposit.title', + options: { + from: { + field: 'account', + type: OPTION_TYPES.ACCOUNT, + label: 'operations.sidechain_btc_create_intermediate_deposit.from', + }, + subject: null, + value: null, + asset: null, + }, + }, sidechain_btc_intermediate_deposit: { value: OPERATIONS_IDS.SIDECHAIN_BTC_INTERMEDIATE_DEPOSIT, name: 'operations.sidechain_btc_intermediate_deposit.title', @@ -1001,39 +1104,39 @@ export const OPERATIONS = { asset: null, }, }, - sidechain_btc_approve_withdraw: { - value: OPERATIONS_IDS.SIDECHAIN_BTC_APPROVE_WITHDRAW, - name: 'operations.sidechain_btc_approve_withdraw.title', + sidechain_btc_aggregate: { + value: OPERATIONS_IDS.SIDECHAIN_BTC_AGGREGATE, + name: 'operations.sidechain_btc_aggregate.title', options: { - from: { - field: 'committee_member_id', - type: OPTION_TYPES.ACCOUNT, - label: 'operations.sidechain_btc_approve_withdraw.from', - }, + from: null, subject: { - field: 'withdraw_id', + field: 'transaction_id', type: OPTION_TYPES.STRING, - label: 'operations.sidechain_btc_approve_withdraw.subject', + label: 'operations.sidechain_btc_aggregate.subject', }, amount: null, asset: null, }, }, - sidechain_btc_aggregate: { - value: OPERATIONS_IDS.SIDECHAIN_BTC_AGGREGATE, - name: 'operations.sidechain_btc_aggregate.title', + sidechain_btc_approve_aggregate: { + value: OPERATIONS_IDS.SIDECHAIN_BTC_APPROVE_AGGREGATE, + name: 'operations.sidechain_btc_approve_aggregate.title', options: { - from: null, + from: { + field: 'committee_member_id', + type: OPTION_TYPES.ACCOUNT, + label: 'operations.sidechain_btc_approve_aggregate.from', + }, subject: { field: 'transaction_id', type: OPTION_TYPES.STRING, - label: 'operations.sidechain_btc_aggregate.subject', + label: 'operations.sidechain_btc_approve_aggregate.subject', }, amount: null, asset: null, }, }, - block_reward_operation: { + block_reward: { value: OPERATIONS_IDS.BLOCK_REWARD, name: 'operations.block_reward.title', options: { diff --git a/app/translations/en.json b/app/translations/en.json index 043fdb1..ff7127f 100644 --- a/app/translations/en.json +++ b/app/translations/en.json @@ -262,6 +262,32 @@ "committee_member_update_global_parameters": { "title": "Global parameters update" }, + "committee_member_activate": { + "title": "Committee member activate" + }, + "committee_member_deactivate": { + "title": "Committee member deactivate" + }, + "committee_frozen_balance_deposit": { + "title": "Committee frozen balance deposit", + "from": "Account" + }, + "committee_frozen_balance_withdraw": { + "title": "Committee frozen balance withdraw", + "from": "Account" + }, + "contract_internal_create": { + "title": "Contract internal create", + "from": "Caller" + }, + "contract_internal_call": { + "title": "Contract internal call", + "from": "Caller" + }, + "contract_selfdestruct": { + "title": "Contract selfdestruct", + "from": "caller" + }, "vesting_balance_create": { "title": "Create vesting balance", "from": "Creator", @@ -397,6 +423,10 @@ "title": "Create BTC address", "from": "Account" }, + "sidechain_btc_create_intermediate_deposit": { + "title": "Intermediate BTC create intermediate deposit", + "from": "Account" + }, "sidechain_btc_intermediate_deposit": { "title": "Intermediate BTC deposit", "from": "Account", @@ -421,6 +451,11 @@ "title": "Aggregate BTC", "subject": "Transaction ID" }, + "sidechain_btc_approve_aggregate": { + "title": "Approve aggregate BTC", + "from": "Committee", + "subject": "Transaction ID" + }, "block_reward": { "title": "Block reward", "subject": "Account" diff --git a/app/translations/ru.json b/app/translations/ru.json index 549cd81..08efb61 100644 --- a/app/translations/ru.json +++ b/app/translations/ru.json @@ -200,6 +200,11 @@ "title.sent": "Перевод отправлен", "title.received": "Перевод получен", "from": "Отправитель", + "subject": "Получатель" + }, + "transfer_to_address": { + "title": "Перевод на адрес", + "from": "Отправитель", "subject": "Получатель" }, "account_create": { @@ -281,7 +286,33 @@ }, "committee_member_update_global_parameters": { "title": "Обновление глобальных параметров" - }, + }, + "committee_member_activate": { + "title": "Активация участника комитета" + }, + "committee_member_deactivate": { + "title": "Деактивация участника комитета" + }, + "committee_frozen_balance_deposit": { + "title": "Committee frozen balance deposit", + "from": "Аккаунт" + }, + "committee_frozen_balance_withdraw": { + "title": "Committee frozen balance withdraw", + "from": "Аккаунт" + }, + "contract_internal_create": { + "title": "Внутреннее создание контракта", + "from": "Caller" + }, + "contract_internal_call": { + "title": "Внутренний вызов контракта", + "from": "Caller" + }, + "contract_selfdestruct": { + "title": "Contract selfdestruct", + "from": "Caller" + }, "vesting_balance_create": { "title": "Создать наделяющий баланс", "from": "Создатель", @@ -334,12 +365,7 @@ "account_address_create": { "title": "Создать адрес аккаунта", "from": "Владелец" - }, - "transfer_to_address": { - "title": "Перевод на адрес", - "from": "Отправитель", - "subject": "Получатель" - }, + }, "sidechain_eth_create_address": { "title": "Сгенерировать ethereum адрес", "from": "Аккаунт" @@ -416,7 +442,11 @@ "sidechain_btc_create_address": { "title": "Создать BTC адрес", "from": "Аккаунт" - }, + }, + "sidechain_btc_create_intermediate_deposit": { + "title": "Создание промежуточного BTC депозита", + "from": "Аккаунт" + }, "sidechain_btc_intermediate_deposit": { "title": "Промежуточный BTC депозит", "from": "Аккаунт", @@ -440,7 +470,12 @@ "sidechain_btc_aggregate": { "title": "Объединение BTC", "subject": "ID транзакции" - }, + }, + "sidechain_btc_approve_aggregate": { + "title": "Одобрение агрегации BTC", + "from": "Комитет", + "subject": "ID транзакции" + }, "block_reward": { "title": "Вознаграждение за блок", "subject": "Аккаунт"