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

Commit 5e1edee

Browse files
committed
Remove burned NFTs from creation list.
1 parent 142084d commit 5e1edee

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

index.js

Lines changed: 21 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)
@@ -202,9 +205,25 @@ const getTzLedger = async (tz, res) => {
202205

203206
console.log(hdao)
204207

208+
var validCreations = []
209+
210+
await Promise.all(creations.map(async (c) => {
211+
c.token_id = c.objectId;
212+
213+
await owners(c)
214+
215+
if (c.owners[BURN_ADDRESS] === undefined) {
216+
delete c.owners
217+
218+
validCreations.push(c)
219+
}
220+
221+
return arr
222+
}));
223+
205224
var arr = []
206-
console.log([...collection, ...creations])
207-
var arr = [...collection, ...creations]
225+
console.log([...collection, ...validCreations])
226+
var arr = [...collection, ...validCreations]
208227

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

0 commit comments

Comments
 (0)