fix(api): Removing API calls that do not use bch-consumer

This commit is contained in:
Chris Troutner
2022-02-02 14:43:45 -08:00
parent a6c3151339
commit bab85451d1
3 changed files with 35 additions and 74 deletions
+17 -13
View File
@@ -6,7 +6,7 @@ import TokenModal from './token-modal'
import Spinner from '../../../images/loader.gif'
// import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import SendTokens from './send-tokens'
import { SlpMutableData } from 'slp-mutable-data'
// import { SlpMutableData } from 'slp-mutable-data'
let _this
class Tokens extends React.Component {
constructor (props) {
@@ -271,20 +271,22 @@ class Tokens extends React.Component {
async handleMutableData (tokensArr) {
try {
const tokens = []
const slpMutableLib = new SlpMutableData()
// const slpMutableLib = new SlpMutableData()
for (let i = 0; i < tokensArr.length; i++) {
const token = tokensArr[i]
try {
const data = await slpMutableLib.get.mutableData(token.tokenId)
token.mutableData = data
// console.log(`data: ${JSON.stringify(data, null, 2)}`)
} catch (error) {
// console.warn(error)
// Skip error
console.log(
`Could not access mutable data for ${token.ticker} (${token.tokenId})`
)
}
// try {
// const data = await slpMutableLib.get.mutableData(token.tokenId)
// token.mutableData = data
// // console.log(`data: ${JSON.stringify(data, null, 2)}`)
// } catch (error) {
// // console.warn(error)
// // Skip error
// console.log(
// `Could not access mutable data for ${token.ticker} (${token.tokenId})`
// )
// }
tokens.push(token)
}
@@ -295,10 +297,12 @@ class Tokens extends React.Component {
}
}
}
Tokens.propTypes = {
walletInfo: PropTypes.object.isRequired, // wallet info
bchWallet: PropTypes.object, // get minimal-slp-wallet instance
setTokensInfo: PropTypes.func.isRequired, // set tokens info
tokensInfo: PropTypes.array // tokens info
}
export default Tokens
+14 -58
View File
@@ -29,9 +29,11 @@ class Footer extends React.Component {
async componentDidMount () {
// Get hash using memo service
await this.handleMemoService()
// await this.handleMemoService()
}
// This function retrieves the IPFS CID for the latest copy of this app. That
// CID is written to the BCH blockchain.
async handleMemoService () {
// This is a hard-coded hash or 'checkpoint' to use in times when the
// connection fails.
@@ -57,80 +59,34 @@ class Footer extends React.Component {
render () {
return (
<section id='footer'>
<Row className='footer-container'>
<Col md={5} className='footer-section'>
<section id="footer">
<Row className="footer-container">
<Col md={12} className="footer-section">
<Row>
<Col md={12} className='mb-1'>
<p className='section-tittle'>Produced By</p>
<Col md={12} className="mb-1">
<p className="section-tittle">Produced By</p>
<a
href={siteConfig.hostUrl}
target='_blank'
rel='noopener noreferrer'
target="_blank"
rel="noopener noreferrer"
>
{siteConfig.hostText}
</a>
</Col>
<Col md={12}>
<p className='section-tittle'>Source Code</p>
<FontAwesomeIcon className='' size='lg' icon={faGithub} />
<p className="section-tittle">Source Code</p>
<FontAwesomeIcon className="" size="lg" icon={faGithub} />
<a
href={siteConfig.sourceCode}
target='_blank'
rel='noopener noreferrer'
target="_blank"
rel="noopener noreferrer"
>
Github
</a>
</Col>
</Row>
</Col>
<Col md={7} className='footer-section'>
<div className='pull-right'>
<p className='section-tittle'>Ways to access this web-app</p>
<ul>
<li id='web'>
<span>
<b>Web</b>
</span>
<b className='bar-space'>|</b>
<a href={siteConfig.clearWebUrl}>{siteConfig.clearWebUrl}</a>
</li>
<li id='tor'>
<span>
<b>Tor</b>
</span>
<b className='bar-space'>|</b>
<a href={`http://${siteConfig.torUrl}`}>
{siteConfig.torUrl}
</a>
</li>
<li id='ipfs'>
<span>
<b>IPFS</b>
</span>
<b className='bar-space'>|</b>
<a href={_this.state.ipfsHashLink}>{this.state.ipfsHash}</a>
</li>
<li id='memo'>
<span>
<b>Memo</b>
</span>
<b className='bar-space'>|</b>
<a
href={`https://memo.cash/profile/${siteConfig.memoAddr}`}
target='_blank'
rel='noopener noreferrer'
>
{siteConfig.memoAddr}
</a>
</li>
</ul>
</div>
</Col>
</Row>
</section>
)
+4 -3
View File
@@ -14,9 +14,10 @@ const config = {
memoAddr: 'bitcoincash:qqwdv3hkmvd5vk0uhwqrqnef54542e5ctvy3ppt0nq',
// Footer Information
hostText: 'FullStack.cash',
hostUrl: 'https://fullstack.cash/',
sourceCode: 'https://github.com/Permissionless-Software-Foundation/gatsby-ipfs-web-wallet',
hostText: 'Permissionless Software Foundation',
hostUrl: 'https://psfoundation.cash/',
sourceCode:
'https://github.com/Permissionless-Software-Foundation/gatsby-theme-bch-wallet',
torUrl: '2egutot63q765ciwsenlcy5zdyxwxt7olzbldr5dx5i3ixsef2nvrzid.onion',
clearWebUrl: 'https://gatsby-ipfs-web-wallet.fullstack.cash'
}