mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-22 09:12:05 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a260f7506a | ||
|
|
9684441d92 | ||
|
|
e793c2a8a9 | ||
|
|
1bf8e59097 | ||
|
|
105ecd6305 | ||
|
|
314040453b | ||
|
|
cbcf5c1d2b |
@@ -146,10 +146,9 @@ class RateLimits {
|
|||||||
// apply paid-access rate limits.
|
// apply paid-access rate limits.
|
||||||
if (
|
if (
|
||||||
origin &&
|
origin &&
|
||||||
(origin.toString().indexOf('wallet.fullstack.cash') > -1 ||
|
(origin.toString().indexOf('fullstack.cash') > -1 ||
|
||||||
origin.toString().indexOf('sandbox.fullstack.cash') > -1 ||
|
|
||||||
origin.toString().indexOf('splitbch.com') > -1 ||
|
origin.toString().indexOf('splitbch.com') > -1 ||
|
||||||
origin === 'slp-api')
|
origin.toString().indexOf('slp-api') > -1)
|
||||||
) {
|
) {
|
||||||
pointsToConsume = 10
|
pointsToConsume = 10
|
||||||
res.locals.pointsToConsume = pointsToConsume // Feedback for tests.
|
res.locals.pointsToConsume = pointsToConsume // Feedback for tests.
|
||||||
@@ -159,7 +158,6 @@ class RateLimits {
|
|||||||
if (
|
if (
|
||||||
// Comment out the line below when running bch-js e2e rate limit tests.
|
// Comment out the line below when running bch-js e2e rate limit tests.
|
||||||
key.toString().indexOf('::ffff:127.0.0.1') > -1 ||
|
key.toString().indexOf('::ffff:127.0.0.1') > -1 ||
|
||||||
|
|
||||||
// Do not comment out this line.
|
// Do not comment out this line.
|
||||||
key.toString().indexOf('172.17.') > -1
|
key.toString().indexOf('172.17.') > -1
|
||||||
) {
|
) {
|
||||||
|
|||||||
+21
-2
@@ -1251,7 +1251,9 @@ class Slp {
|
|||||||
const tokenRes = await _this.axios.request(opt)
|
const tokenRes = await _this.axios.request(opt)
|
||||||
// console.log(`tokenRes: ${util.inspect(tokenRes)}`)
|
// console.log(`tokenRes: ${util.inspect(tokenRes)}`)
|
||||||
|
|
||||||
if (tokenRes.data.c.length === 0) {
|
// Return 'not found' error if both the confirmed and unconfirmed
|
||||||
|
// collections are empty.
|
||||||
|
if (tokenRes.data.c.length === 0 && tokenRes.data.u.length === 0) {
|
||||||
res.status(404)
|
res.status(404)
|
||||||
return res.json({ error: 'TXID not found' })
|
return res.json({ error: 'TXID not found' })
|
||||||
}
|
}
|
||||||
@@ -1437,12 +1439,29 @@ class Slp {
|
|||||||
sendOutputs.push(string.toString())
|
sendOutputs.push(string.toString())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Because you are not using Insight API indexer, you do not get the
|
||||||
|
// sending addresses from an indexer or from the node.
|
||||||
|
// However, they are available from the SLPDB output.
|
||||||
|
const tokenInputs = transaction.in
|
||||||
|
// Collect the input addresses
|
||||||
|
const sendInputs = []
|
||||||
|
for (let i = 0; i < tokenInputs.length; i += 1) {
|
||||||
|
const tokenInput = tokenInputs[i]
|
||||||
|
const sendInput = {}
|
||||||
|
sendInput.address = tokenInput.e.a
|
||||||
|
sendInputs.push(sendInput)
|
||||||
|
}
|
||||||
|
|
||||||
const obj = {
|
const obj = {
|
||||||
tokenInfo: {
|
tokenInfo: {
|
||||||
versionType: transaction.slp.detail.versionType,
|
versionType: transaction.slp.detail.versionType,
|
||||||
|
tokenName: transaction.slp.detail.name,
|
||||||
|
tokenTicker: transaction.slp.detail.symbol,
|
||||||
transactionType: transaction.slp.detail.transactionType,
|
transactionType: transaction.slp.detail.transactionType,
|
||||||
tokenIdHex: transaction.slp.detail.tokenIdHex,
|
tokenIdHex: transaction.slp.detail.tokenIdHex,
|
||||||
sendOutputs: sendOutputs
|
sendOutputs: sendOutputs,
|
||||||
|
sendInputsFull: sendInputs,
|
||||||
|
sendOutputsFull: transaction.slp.detail.outputs
|
||||||
},
|
},
|
||||||
tokenIsValid: transaction.slp.valid
|
tokenIsValid: transaction.slp.valid
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user