diff --git a/package.json b/package.json index 0d5a3f8..24a7101 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "test": "nyc mocha --trace-warnings --unhandled-rejections=strict --timeout 30000 test/unit/", "test:integration": "npm run test:integration:bchn", "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", - "test:integration:abc": "export RESTURL=https://abc.fullstack.cash/v5/ && export IS_USING_FREE_TIER=true && mocha --timeout 30000 test/integration/ && mocha --timeout 30000 test/integration/chains/abc/", + "test:integration:abc": "export RESTURL=https://abc.fullstack.cash/v5/ && mocha --timeout 30000 test/integration/ && mocha --timeout 30000 test/integration/chains/abc/", "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/", "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/", "test:integration:local:abc": "export RESTURL=http://localhost:3000/v5/ && mocha --timeout 30000 test/integration && mocha --timeout 30000 test/integration/chains/abc/", diff --git a/src/psf-slp-indexer.js b/src/psf-slp-indexer.js index 6484906..2e9f803 100644 --- a/src/psf-slp-indexer.js +++ b/src/psf-slp-indexer.js @@ -194,6 +194,7 @@ class PsfSlpIndexer { * } * } * + * */ async tokenStats (tokenId, withTxHistory = false) { @@ -420,7 +421,7 @@ class PsfSlpIndexer { * } * */ - async getTokenData (tokenId) { + async getTokenData (tokenId, withTxHistory = false) { try { const url = `${this.restURL}psf/slp/token/data` // console.log(`url: ${url}`) @@ -430,7 +431,7 @@ class PsfSlpIndexer { const response = await axios.post( // 'https://bchn.fullstack.cash/v5/psf/slp/token/data/', url, - { tokenId }, + { tokenId, withTxHistory }, this.axiosOptions ) return response.data diff --git a/test/integration/chains/bchn/psf-slp-indexer.integration.js b/test/integration/chains/bchn/psf-slp-indexer.integration.js index ba0a317..11d0a38 100644 --- a/test/integration/chains/bchn/psf-slp-indexer.integration.js +++ b/test/integration/chains/bchn/psf-slp-indexer.integration.js @@ -145,6 +145,15 @@ describe('#psf-slp-indexer', () => { assert.isString(result.immutableData) assert.isString(result.mutableData) }) + + it('should get token data with a transaction history', async () => { + const tokenId = '43eddfb11c9941edffb8c8815574bb0a43969a7b1de39ad14cd043eaa24fd38d' + + const result = await bchjs.PsfSlpIndexer.getTokenData(tokenId, true) + // console.log('result: ', result) + + assert.isArray(result.genesisData.txs) + }) }) })