@psf/bch-js 6.4.4 → 6.4.5
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@psf/bch-js",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.5",
|
|
4
4
|
"description": "A JavaScript library for working with Bitcoin Cash, eCash, and SLP Tokens",
|
|
5
5
|
"author": "Chris Troutner <chris.troutner@gmail.com>",
|
|
6
6
|
"contributors": [
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"test": "nyc mocha --trace-warnings --unhandled-rejections=strict --timeout 30000 test/unit/",
|
|
13
13
|
"test:integration": "npm run test:integration:bchn",
|
|
14
14
|
"test:integration:nft": "export RESTURL=https://bchn.fullstack.cash/v5/ && export IS_USING_FREE_TIER=true && mocha --timeout 30000 -g '#nft1' test/integration/chains/bchn/slp.js",
|
|
15
|
-
"test:integration:abc": "export RESTURL=https://abc.fullstack.cash/v5/ &&
|
|
15
|
+
"test:integration:abc": "export RESTURL=https://abc.fullstack.cash/v5/ && mocha --timeout 30000 test/integration/ && mocha --timeout 30000 test/integration/chains/abc/",
|
|
16
16
|
"test:integration:bchn": "export RESTURL=https://bchn.fullstack.cash/v5/ && export IS_USING_FREE_TIER=true && mocha --timeout 30000 test/integration/ && mocha --timeout 30000 test/integration/chains/bchn/",
|
|
17
17
|
"test:integration:bchn:slpdb": "export TESTSLP=1 && export RESTURL=https://bchn.fullstack.cash/v5/ && export IS_USING_FREE_TIER=true && mocha --timeout 30000 test/integration/ && mocha --timeout 30000 test/integration/chains/bchn/",
|
|
18
18
|
"test:integration:local:abc": "export RESTURL=http://localhost:3000/v5/ && mocha --timeout 30000 test/integration && mocha --timeout 30000 test/integration/chains/abc/",
|
package/src/psf-slp-indexer.js
CHANGED
|
@@ -194,6 +194,7 @@ class PsfSlpIndexer {
|
|
|
194
194
|
* }
|
|
195
195
|
* }
|
|
196
196
|
*
|
|
197
|
+
*
|
|
197
198
|
*/
|
|
198
199
|
|
|
199
200
|
async tokenStats (tokenId, withTxHistory = false) {
|
|
@@ -420,7 +421,7 @@ class PsfSlpIndexer {
|
|
|
420
421
|
* }
|
|
421
422
|
*
|
|
422
423
|
*/
|
|
423
|
-
async getTokenData (tokenId) {
|
|
424
|
+
async getTokenData (tokenId, withTxHistory = false) {
|
|
424
425
|
try {
|
|
425
426
|
const url = `${this.restURL}psf/slp/token/data`
|
|
426
427
|
// console.log(`url: ${url}`)
|
|
@@ -430,7 +431,7 @@ class PsfSlpIndexer {
|
|
|
430
431
|
const response = await axios.post(
|
|
431
432
|
// 'https://bchn.fullstack.cash/v5/psf/slp/token/data/',
|
|
432
433
|
url,
|
|
433
|
-
{ tokenId },
|
|
434
|
+
{ tokenId, withTxHistory },
|
|
434
435
|
this.axiosOptions
|
|
435
436
|
)
|
|
436
437
|
return response.data
|
|
@@ -145,6 +145,15 @@ describe('#psf-slp-indexer', () => {
|
|
|
145
145
|
assert.isString(result.immutableData)
|
|
146
146
|
assert.isString(result.mutableData)
|
|
147
147
|
})
|
|
148
|
+
|
|
149
|
+
it('should get token data with a transaction history', async () => {
|
|
150
|
+
const tokenId = '43eddfb11c9941edffb8c8815574bb0a43969a7b1de39ad14cd043eaa24fd38d'
|
|
151
|
+
|
|
152
|
+
const result = await bchjs.PsfSlpIndexer.getTokenData(tokenId, true)
|
|
153
|
+
// console.log('result: ', result)
|
|
154
|
+
|
|
155
|
+
assert.isArray(result.genesisData.txs)
|
|
156
|
+
})
|
|
148
157
|
})
|
|
149
158
|
})
|
|
150
159
|
|