Skip to content
This repository was archived by the owner on Nov 10, 2021. It is now read-only.

Commit 10b38a8

Browse files
committed
Merge commit 'e61d98238e623a51eeef40cc1219da458bcc64f9' into hdao_feed_filter
* commit 'e61d98238e623a51eeef40cc1219da458bcc64f9': Ensure that all issues are owned by burn address. Remove semicolons Remove burned NFTs from creation list.
2 parents 0c2d361 + e61d982 commit 10b38a8

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

index.js

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ const cors = require('cors')
55
const _ = require('lodash')
66
const conseilUtil = require('./conseilUtil')
77
const { random } = require('lodash')
8+
9+
const BURN_ADDRESS = 'tz1burnburnburnburnburnburnburjAYjjX'
10+
811
require('dotenv').config()
912

1013
const reducer = (accumulator, currentValue) => parseInt(accumulator) + parseInt(currentValue)
@@ -207,9 +210,28 @@ const getTzLedger = async (tz, res) => {
207210

208211
console.log(hdao)
209212

213+
var validCreations = []
214+
215+
await Promise.all(creations.map(async (c) => {
216+
c.token_id = c.objectId
217+
218+
await owners(c)
219+
220+
var burnAddrCount = c.owners[BURN_ADDRESS]
221+
var allIssuesBurned = burnAddrCount && burnAddrCount === c.total_amount
222+
223+
if (!allIssuesBurned) {
224+
delete c.owners
225+
226+
validCreations.push(c)
227+
}
228+
229+
return arr
230+
}))
231+
210232
var arr = []
211-
console.log([...collection, ...creations])
212-
var arr = [...collection, ...creations]
233+
console.log([...collection, ...validCreations])
234+
var arr = [...collection, ...validCreations]
213235

214236
var result = arr.map(async e => {
215237
e.token_info = await getIpfsHash(e.ipfsHash)

0 commit comments

Comments
 (0)