import csv
import json
import datetime

mintTable = []
nftTable = []
nftTransferTable = []

contracts = lambda : json.load(open('contract.json', 'r'))

def exportMintTable():
    rows = []
    with open('mint.raw.csv', 'w', newline='') as f:
        writer = csv.writer(f)
        writer.writerows(rows)

def exportNftTable():
    rows = []
    with open('nft.raw.csv', 'w', newline='') as f:
        writer = csv.writer(f)
        writer.writerows(rows)

def exportNftTransferTable():
    rows = []
    with open('nft_transfer.raw.csv', 'w', newline='') as f:
        writer = csv.writer(f)
        writer.writerows(rows)

def exportNftSumTable():
    rows = []
    for nft in nftTable:
        rows.push(
            (
                nft['token_id'],
                nft['token_type'],
                nft['creator_address'],
                nft['owner_address'],
                nft['tags'],
                datetime.datetime.fromtimestamp(nft['modifytime'])
            )
        )
    with open('nft.sum.csv', 'w', newline='') as f:
        writer = csv.writer(f)
        writer.writerows(rows)


print('hello')
