mirror of
https://github.com/Permissionless-Software-Foundation/bch-js.git
synced 2026-09-21 16:51:59 -07:00
Using config.restURL instead of hard-coded URL
This commit is contained in:
@@ -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')
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user