This repository was archived by the owner on Nov 10, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed
Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ const cors = require('cors')
55const _ = require ( 'lodash' )
66const conseilUtil = require ( './conseilUtil' )
77const { random } = require ( 'lodash' )
8+
9+ const BURN_ADDRESS = 'tz1burnburnburnburnburnburnburjAYjjX'
10+
811require ( 'dotenv' ) . config ( )
912
1013const reducer = ( accumulator , currentValue ) => parseInt ( accumulator ) + parseInt ( currentValue )
@@ -202,9 +205,28 @@ 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+ var burnAddrCount = c . owners [ BURN_ADDRESS ]
216+ var allIssuesBurned = burnAddrCount && burnAddrCount === c . total_amount
217+
218+ if ( ! allIssuesBurned ) {
219+ delete c . owners
220+
221+ validCreations . push ( c )
222+ }
223+
224+ return arr
225+ } ) )
226+
205227 var arr = [ ]
206- console . log ( [ ...collection , ...creations ] )
207- var arr = [ ...collection , ...creations ]
228+ console . log ( [ ...collection , ...validCreations ] )
229+ var arr = [ ...collection , ...validCreations ]
208230
209231 var result = arr . map ( async e => {
210232 e . token_info = await getIpfsHash ( e . ipfsHash )
You can’t perform that action at this time.
0 commit comments