From c7fbf5ea9feb3ed04e9ea2c639ef774f702ac103 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sun, 6 Feb 2022 13:02:16 -0800 Subject: [PATCH 1/2] fix(PsfSlpIndexer): Adding optional tx history flag to slp/tx endpoint --- src/routes/v5/psf-slp-indexer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/routes/v5/psf-slp-indexer.js b/src/routes/v5/psf-slp-indexer.js index bd76003..d22080f 100644 --- a/src/routes/v5/psf-slp-indexer.js +++ b/src/routes/v5/psf-slp-indexer.js @@ -161,6 +161,10 @@ class PsfSlpIndexer { }) } + // Flag to toggle tx history of the token. + let withTxHistory = false + if (req.body.withTxHistory) withTxHistory = true + if (txid.length !== 64) { res.status(400) return res.json({ @@ -171,7 +175,7 @@ class PsfSlpIndexer { const response = await _this.axios.post( `${_this.psfSlpIndexerApi}slp/tx/`, - { txid } + { txid, withTxHistory } ) res.status(200) From 882bb065b34f4c3c0f6e94335c7a7969aef489fb Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sun, 6 Feb 2022 13:04:02 -0800 Subject: [PATCH 2/2] Fixing typo --- src/routes/v5/psf-slp-indexer.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/routes/v5/psf-slp-indexer.js b/src/routes/v5/psf-slp-indexer.js index d22080f..491a55f 100644 --- a/src/routes/v5/psf-slp-indexer.js +++ b/src/routes/v5/psf-slp-indexer.js @@ -161,10 +161,6 @@ class PsfSlpIndexer { }) } - // Flag to toggle tx history of the token. - let withTxHistory = false - if (req.body.withTxHistory) withTxHistory = true - if (txid.length !== 64) { res.status(400) return res.json({ @@ -175,7 +171,7 @@ class PsfSlpIndexer { const response = await _this.axios.post( `${_this.psfSlpIndexerApi}slp/tx/`, - { txid, withTxHistory } + { txid } ) res.status(200) @@ -187,7 +183,7 @@ class PsfSlpIndexer { } /** - * @api {post} /psf/slp/tokenStats/ List stats for a single slp token. + * @api {post} /psf/slp/token List stats for a single slp token. * @apiName List stats for a single slp token. * @apiGroup PSF SLP * @apiDescription Return list stats for a single slp token. @@ -212,9 +208,13 @@ class PsfSlpIndexer { }) } + // Flag to toggle tx history of the token. + let withTxHistory = false + if (req.body.withTxHistory) withTxHistory = true + const response = await _this.axios.post( `${_this.psfSlpIndexerApi}slp/token/`, - { tokenId } + { tokenId, withTxHistory } ) res.status(200)