mirror of
https://github.com/fullstack-cash/fullstack-gatsby-theme-bch-wallet.git
synced 2026-09-21 16:52:06 -07:00
feat(price): Get price from minimal-slp-wallet and not bch-js
This commit is contained in:
@@ -303,16 +303,7 @@ class Servers extends React.Component {
|
||||
await bchWalletLib.walletInfoPromise
|
||||
const myBalance = await bchWalletLib.getBalance()
|
||||
|
||||
const bchjs = bchWalletLib.bchjs
|
||||
|
||||
let currentRate
|
||||
|
||||
if (bchjs.restURL.includes('abc.fullstack')) {
|
||||
currentRate = (await bchjs.Price.getBchaUsd()) * 100
|
||||
} else {
|
||||
// BCHN price.
|
||||
currentRate = (await bchjs.Price.getUsd()) * 100
|
||||
}
|
||||
const currentRate = (await bchWalletLib.getUsd()) * 100
|
||||
|
||||
_this.setState({
|
||||
currentRate: currentRate
|
||||
|
||||
@@ -284,16 +284,8 @@ class Send extends React.Component {
|
||||
// update balance
|
||||
setTimeout(async () => {
|
||||
const myBalance = await bchWalletLib.getBalance()
|
||||
const bchjs = bchWalletLib.bchjs
|
||||
|
||||
let currentRate
|
||||
|
||||
if (bchjs.restURL.includes('abc.fullstack')) {
|
||||
currentRate = (await bchjs.Price.getBchaUsd()) * 100
|
||||
} else {
|
||||
// BCHN price.
|
||||
currentRate = (await bchjs.Price.getUsd()) * 100
|
||||
}
|
||||
const currentRate = (await bchWalletLib.getUsd()) * 100
|
||||
|
||||
_this.props.updateBalance({ myBalance, currentRate })
|
||||
}, 1000)
|
||||
@@ -365,16 +357,8 @@ class Send extends React.Component {
|
||||
// update balance
|
||||
setTimeout(async () => {
|
||||
const myBalance = await bchWalletLib.getBalance()
|
||||
const bchjs = bchWalletLib.bchjs
|
||||
|
||||
let currentRate
|
||||
|
||||
if (bchjs.restURL.includes('abc.fullstack')) {
|
||||
currentRate = (await bchjs.Price.getBchaUsd()) * 100
|
||||
} else {
|
||||
// BCHN price.
|
||||
currentRate = (await bchjs.Price.getUsd()) * 100
|
||||
}
|
||||
const currentRate = (await bchWalletLib.getUsd()) * 100
|
||||
|
||||
_this.props.updateBalance({ myBalance, currentRate })
|
||||
}, 1000)
|
||||
|
||||
@@ -97,16 +97,7 @@ class NewWallet extends React.Component {
|
||||
|
||||
const myBalance = await bchWalletLib.getBalance()
|
||||
|
||||
const bchjs = bchWalletLib.bchjs
|
||||
|
||||
let currentRate
|
||||
|
||||
if (bchjs.restURL.includes('abc.fullstack')) {
|
||||
currentRate = (await bchjs.Price.getBchaUsd()) * 100
|
||||
} else {
|
||||
// BCHN price.
|
||||
currentRate = (await bchjs.Price.getUsd()) * 100
|
||||
}
|
||||
const currentRate = (await bchWalletLib.getUsd()) * 100
|
||||
|
||||
// console.log("myBalance", myBalance)
|
||||
// Update redux state
|
||||
|
||||
@@ -135,15 +135,7 @@ class ImportWallet extends React.Component {
|
||||
Object.assign(currentWallet, walletInfo)
|
||||
|
||||
const myBalance = await bchWalletLib.getBalance()
|
||||
const bchjs = bchWalletLib.bchjs
|
||||
let currentRate
|
||||
|
||||
if (bchjs.restURL.includes('abc.fullstack')) {
|
||||
currentRate = (await bchjs.Price.getBchaUsd()) * 100
|
||||
} else {
|
||||
// BCHN price.
|
||||
currentRate = (await bchjs.Price.getUsd()) * 100
|
||||
}
|
||||
const currentRate = (await bchWalletLib.getUsd()) * 100
|
||||
|
||||
_this.setState({
|
||||
currentRate: currentRate
|
||||
|
||||
Reference in New Issue
Block a user