Using config.restURL instead of hard-coded URL

This commit is contained in:
Chris Troutner
2022-05-07 20:20:30 -07:00
parent 7b6eebe7c7
commit 7da010e7af
3 changed files with 7 additions and 2 deletions
+5 -1
View File
@@ -422,10 +422,14 @@ class PsfSlpIndexer {
*/ */
async getTokenData (tokenId) { async getTokenData (tokenId) {
try { try {
const url = `${this.restURL}psf/slp/token/data`
// console.log(`url: ${url}`)
// Handle single address. // Handle single address.
if (typeof tokenId === 'string') { if (typeof tokenId === 'string') {
const response = await axios.post( const response = await axios.post(
'https://bchn.fullstack.cash/v5/psf/slp/token/data/', // 'https://bchn.fullstack.cash/v5/psf/slp/token/data/',
url,
{ tokenId }, { tokenId },
this.axiosOptions this.axiosOptions
) )
@@ -131,7 +131,7 @@ describe('#psf-slp-indexer', () => {
'f055256b938f1ecfa270459d6f12c7c8c82b66d3263c03d5074445a2b1a498a3' 'f055256b938f1ecfa270459d6f12c7c8c82b66d3263c03d5074445a2b1a498a3'
const result = await bchjs.PsfSlpIndexer.getTokenData(tokenId) const result = await bchjs.PsfSlpIndexer.getTokenData(tokenId)
console.log('result: ', result) // console.log('result: ', result)
assert.property(result, 'genesisData') assert.property(result, 'genesisData')
assert.property(result, 'immutableData') assert.property(result, 'immutableData')
+1
View File
@@ -336,6 +336,7 @@ describe('#PsfSlpIndexer', () => {
assert.equal(result, false) assert.equal(result, false)
}) })
}) })
describe('#getTokenData', () => { describe('#getTokenData', () => {
it('should GET token data', async () => { it('should GET token data', async () => {
// Stub the network call. // Stub the network call.