mirror of
https://github.com/Permissionless-Software-Foundation/psf-bch-api-base.git
synced 2026-09-21 16:52:00 -07:00
fix(slp): Removing the data2 path as it never worked well
This commit is contained in:
@@ -32,7 +32,6 @@ class SlpRESTController {
|
||||
this.getTxid = this.getTxid.bind(this)
|
||||
this.getTokenStats = this.getTokenStats.bind(this)
|
||||
this.getTokenData = this.getTokenData.bind(this)
|
||||
this.getTokenData2 = this.getTokenData2.bind(this)
|
||||
this.handleError = this.handleError.bind(this)
|
||||
}
|
||||
|
||||
@@ -206,32 +205,6 @@ class SlpRESTController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {post} /v6/slp/token/data2 Get expanded token data
|
||||
* @apiName GetTokenData2
|
||||
* @apiGroup SLP
|
||||
* @apiDescription Get expanded data for the token, including icons.
|
||||
*/
|
||||
async getTokenData2 (req, res) {
|
||||
try {
|
||||
const tokenId = req.body.tokenId
|
||||
|
||||
if (!tokenId || tokenId === '') {
|
||||
return res.status(400).json({
|
||||
success: false,
|
||||
error: 'tokenId can not be empty'
|
||||
})
|
||||
}
|
||||
|
||||
const updateCache = req.body.updateCache
|
||||
|
||||
const result = await this.slpUseCases.getTokenData2({ tokenId, updateCache })
|
||||
return res.status(200).json(result)
|
||||
} catch (err) {
|
||||
return this.handleError(err, res)
|
||||
}
|
||||
}
|
||||
|
||||
handleError (err, res) {
|
||||
wlogger.error('Error in SlpRESTController:', err)
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ class SlpRouter {
|
||||
this.router.post('/txid', this.slpController.getTxid)
|
||||
this.router.post('/token', this.slpController.getTokenStats)
|
||||
this.router.post('/token/data', this.slpController.getTokenData)
|
||||
this.router.post('/token/data2', this.slpController.getTokenData2)
|
||||
|
||||
app.use(this.baseUrl, this.router)
|
||||
}
|
||||
|
||||
@@ -146,18 +146,6 @@ class SlpUseCases {
|
||||
}
|
||||
}
|
||||
|
||||
async getTokenData2 ({ tokenId, updateCache }) {
|
||||
try {
|
||||
await this._ensureInitialized()
|
||||
|
||||
const tokenData = await this.slpTokenMedia.getIcon({ tokenId, updateCache })
|
||||
return tokenData
|
||||
} catch (err) {
|
||||
wlogger.error('Error in SlpUseCases.getTokenData2()', err)
|
||||
throw err
|
||||
}
|
||||
}
|
||||
|
||||
async getMutableCid ({ tokenStats }) {
|
||||
// Validate input - this should throw, not be caught
|
||||
if (!tokenStats || !tokenStats.documentHash) {
|
||||
|
||||
Reference in New Issue
Block a user