Merge pull request #110 from Permissionless-Software-Foundation/ct-unstable

fix(fee): Allowing tx fee assigned with env var
This commit is contained in:
Chris Troutner
2020-11-20 20:12:57 -08:00
committed by GitHub
2 changed files with 9 additions and 1 deletions
+3 -1
View File
@@ -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
+6
View File
@@ -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