mirror of
https://github.com/fullstack-cash/fullstack-gatsby-theme-bch-wallet.git
synced 2026-09-21 16:52:06 -07:00
Merge pull request #110 from Permissionless-Software-Foundation/ct-unstable
fix(fee): Allowing tx fee assigned with env var
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user