diff --git a/src/components/admin-lte/index.js b/src/components/admin-lte/index.js index be4437f..ea2ebc7 100644 --- a/src/components/admin-lte/index.js +++ b/src/components/admin-lte/index.js @@ -125,6 +125,7 @@ class AdminLTEPage extends React.Component { _this.setState({ inFetch: true }) + const { mnemonic } = _this.props.walletInfo if (mnemonic && _this.props.bchWallet) { const bchWalletLib = _this.props.bchWallet @@ -136,7 +137,7 @@ class AdminLTEPage extends React.Component { let currentRate if (bchjs.restURL.includes('abc.fullstack')) { - currentRate = await bchjs.Price.getBchaUsd() * 100 + currentRate = (await bchjs.Price.getBchaUsd()) * 100 } else { // BCHN price. currentRate = (await bchjs.Price.getUsd()) * 100 @@ -415,6 +416,7 @@ class AdminLTEPage extends React.Component { } } } + // Props prvided by redux AdminLTEPage.propTypes = { walletInfo: PropTypes.object.isRequired, // wallet info 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