From bb29225376d016e60ce4b49e1d5e70b914ef2d87 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Fri, 20 Nov 2020 20:11:22 -0800 Subject: [PATCH] fix(fee): Allowing tx fee assigned with env var --- src/components/admin-lte/index.js | 22 +++++++++++----------- src/redux/createStore.js | 6 ++++++ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/components/admin-lte/index.js b/src/components/admin-lte/index.js index c32d03e..ea2ebc7 100644 --- a/src/components/admin-lte/index.js +++ b/src/components/admin-lte/index.js @@ -60,18 +60,18 @@ class AdminLTEPage extends React.Component { - + -
+
{!_this.state.inFetch && ( -
+

{siteConfig.balanceText}

@@ -81,9 +81,9 @@ class AdminLTEPage extends React.Component { USD: ${_this.state.usdBalance}
@@ -101,8 +101,8 @@ class AdminLTEPage extends React.Component { - -
+ +
{_this.renderNewViewItems(_this.props)}
@@ -363,7 +363,7 @@ class AdminLTEPage extends React.Component { return (
  • {/* Adding this childrens prevents console errors */} - + diff --git a/src/redux/createStore.js b/src/redux/createStore.js index c654e13..5d4b033 100644 --- a/src/redux/createStore.js +++ b/src/redux/createStore.js @@ -78,6 +78,12 @@ const instanceWallet = () => { if (restURL) { bchjsOptions.restURL = restURL } + + // Assign the tx fee based on environment variable + const FEE = process.env.FEE ? process.env.FEE : 1 + bchjsOptions.fee = FEE + console.log(`Using ${bchjsOptions.fee} sats per byte for tx fees.`) + const bchWalletLib = new BchWallet(localStorageInfo.mnemonic, bchjsOptions) // Update bchjs instances of minimal-slp-wallet libraries