@psf/bch-js 6.5.0 → 6.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/psf-slp-indexer.js
CHANGED
|
@@ -449,6 +449,18 @@ class PsfSlpIndexer {
|
|
|
449
449
|
* @apiGroup PSF SLP
|
|
450
450
|
* @apiDescription Get token icon and other media associated with a token.
|
|
451
451
|
*
|
|
452
|
+
* Get the icon for a token, given it's token ID.
|
|
453
|
+
* This function expects a string input of a token ID property.
|
|
454
|
+
* This function returns an object with a tokenIcon property that contains
|
|
455
|
+
* the URL to the icon.
|
|
456
|
+
*
|
|
457
|
+
* The output object always have these properties:
|
|
458
|
+
* - tokenIcon: A url to the token icon, if it exists.
|
|
459
|
+
* - tokenStats: Data about the token from psf-slp-indexer.
|
|
460
|
+
* - optimizedTokenIcon: An alternative, potentially more optimal, url to the token icon, if it exists.
|
|
461
|
+
* - iconRepoCompatible: true if the token icon is available via token.bch.sx
|
|
462
|
+
* - ps002Compatible: true if the token icon is compatible with PS007 specification.
|
|
463
|
+
*
|
|
452
464
|
* @apiExample Example usage:
|
|
453
465
|
* (async () => {
|
|
454
466
|
* try {
|
|
@@ -520,7 +532,7 @@ class PsfSlpIndexer {
|
|
|
520
532
|
|
|
521
533
|
throw new Error('Input tokenId must be a string.')
|
|
522
534
|
} catch (error) {
|
|
523
|
-
console.log('error: ', error)
|
|
535
|
+
// console.log('error: ', error)
|
|
524
536
|
if (error.response && error.response.data) throw error.response.data
|
|
525
537
|
else throw error
|
|
526
538
|
}
|
|
@@ -163,7 +163,7 @@ describe('#psf-slp-indexer', () => {
|
|
|
163
163
|
|
|
164
164
|
// bchjs.PsfSlpIndexer.restURL = 'http://localhost:3000/v5/'
|
|
165
165
|
const result = await bchjs.PsfSlpIndexer.getTokenData2(tokenId)
|
|
166
|
-
console.log('result: ', result)
|
|
166
|
+
// console.log('result: ', result)
|
|
167
167
|
|
|
168
168
|
assert.property(result, 'tokenStats')
|
|
169
169
|
assert.property(result, 'mutableData')
|