From 2639aab09387848ee9cfde08e1be59457ea6f87c Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Fri, 28 Dec 2018 15:58:09 +0100 Subject: [PATCH] add fee levels to appConfig.json --- public/data/appConfig.json | 29 +++++++++++++++++++++++++++++ src/reducers/LocalStorageReducer.js | 20 ++++++++++++++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/public/data/appConfig.json b/public/data/appConfig.json index 63717169..aa7861f8 100644 --- a/public/data/appConfig.json +++ b/public/data/appConfig.json @@ -52,6 +52,18 @@ "defaultGasLimit": 21000, "defaultGasLimitTokens": 200000, "decimals": 18, + "fee": { + "defaultFee": "64", + "minFee": "10", + "maxFee": "10000", + "defaultGasLimit": "21000", + "defaultGasLimitTokens": "200000", + "levels": [ + { "name": "High", "value": "96", "multiplier": 1.5 }, + { "name": "Normal", "value": "64", "multiplier": 1, "recommended": true }, + { "name": "Low", "value": "48", "multiplier": 0.75 } + ] + }, "tokens": "./data/ropstenTokens.json", "web3": [ "wss://ropsten1.trezor.io/geth" @@ -68,6 +80,14 @@ "shortcut": "xrp", "bip44": "m/44'/144'/a'/0/0", "decimals": 6, + "fee": { + "defaultFee": "12", + "minFee": "10", + "maxFee": "10000", + "levels": [ + {"name": "Normal", "value": "12", "recommended": true } + ] + }, "explorer": { "tx": "https://xrpcharts.ripple.com/#/transactions/", "address": "https://xrpcharts.ripple.com/#/graph/" @@ -81,6 +101,15 @@ "shortcut": "txrp", "bip44": "m/44'/144'/a'/0/0", "decimals": 6, + "fee": { + "defaultFee": "12", + "minFee": "10", + "maxFee": "10000", + "levels": [ + {"name": "High", "value": "20" }, + {"name": "Normal", "value": "10", "recommended": true } + ] + }, "explorer": { "tx": "https://sisyfos.trezor.io/ripple-testnet-explorer/tx/", "address": "https://sisyfos.trezor.io/ripple-testnet-explorer/address/" diff --git a/src/reducers/LocalStorageReducer.js b/src/reducers/LocalStorageReducer.js index cfe90c4b..6d08f6ad 100644 --- a/src/reducers/LocalStorageReducer.js +++ b/src/reducers/LocalStorageReducer.js @@ -5,6 +5,14 @@ import * as STORAGE from 'actions/constants/localStorage'; import type { Action } from 'flowtype'; +type NetworkFeeLevel = { + name: string, + value: string, // ETH: gasPrice in gwei, XRP: fee in drops, BTC: sat/b + multiplier: number, // ETH specific + blocks: number, // BTC specific + recommended: boolean, +}; + export type Network = { type: string; name: string; @@ -15,13 +23,21 @@ export type Network = { defaultGasLimit: number; defaultGasLimitTokens: number; defaultGasPrice: number; - chainId: number; + chainId: number; // ETH specific explorer: { tx: string; address: string; }; tokens: string; - decimals: number, + decimals: number; + fee: { + defaultFee: string; + minFee: string; + maxFee: string; + defaultGasLimit: string; // ETH specific + defaultGasLimitTokens: string; // ETH specific + levels: Array; + }, backends: Array<{ name: string; urls: Array;