mirror of
https://github.com/fullstack-cash/fullstack-gatsby-theme-bch-wallet.git
synced 2026-09-21 16:52:06 -07:00
feat(tokens): Token data retrieved using minimal-slp-wallet
This commit is contained in:
@@ -286,8 +286,15 @@ class Tokens extends React.Component {
|
|||||||
const token = tokensArr[i]
|
const token = tokensArr[i]
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// OLD code. This can be deleted.
|
||||||
|
// // Get token data from bch-api.
|
||||||
|
// const tokenData = await bchjs.PsfSlpIndexer.getTokenData(token.tokenId)
|
||||||
|
// // console.log(`tokenData ${i}: ${JSON.stringify(tokenData, null, 2)}`)
|
||||||
|
|
||||||
|
await bchWalletLib.walletInfoPromise
|
||||||
|
|
||||||
// Get token data from bch-api.
|
// Get token data from bch-api.
|
||||||
const tokenData = await bchjs.PsfSlpIndexer.getTokenData(token.tokenId)
|
const tokenData = await bchWalletLib.getTokenData(token.tokenId)
|
||||||
// console.log(`tokenData ${i}: ${JSON.stringify(tokenData, null, 2)}`)
|
// console.log(`tokenData ${i}: ${JSON.stringify(tokenData, null, 2)}`)
|
||||||
|
|
||||||
// Extract the raw CID.
|
// Extract the raw CID.
|
||||||
@@ -309,6 +316,7 @@ class Tokens extends React.Component {
|
|||||||
token.immutableData = immutableData.data
|
token.immutableData = immutableData.data
|
||||||
// console.log('token.immutableData: ', token.immutableData)
|
// console.log('token.immutableData: ', token.immutableData)
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn(error)
|
console.warn(error)
|
||||||
// Skip error
|
// Skip error
|
||||||
|
|||||||
Reference in New Issue
Block a user