1
This commit is contained in:
parent
5484ba53b2
commit
fca32c0d7d
@ -27,6 +27,7 @@ function jsonToCsv(fileName, data, fields) {
|
|||||||
fs.writeFileSync(fileName, out);
|
fs.writeFileSync(fileName, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const heroList = [30100, 30300, 30400, 30500, 30600, 30800, 30900];
|
||||||
const airDropDate = utils.getArgv('f');
|
const airDropDate = utils.getArgv('f');
|
||||||
const json = utils.readJsonFromFile
|
const json = utils.readJsonFromFile
|
||||||
(`../bin_dev/web3tools/config/airdrops/${airDropDate}.airdrop@${airDropDate}.airdrop.json`);
|
(`../bin_dev/web3tools/config/airdrops/${airDropDate}.airdrop@${airDropDate}.airdrop.json`);
|
||||||
@ -39,16 +40,16 @@ json.forEach(
|
|||||||
throw new Error('error address');
|
throw new Error('error address');
|
||||||
}
|
}
|
||||||
item['type'] = 'hero';
|
item['type'] = 'hero';
|
||||||
item['item_id'] = 1;
|
item['item_id'] = heroList[utils.randRange(0, 7)];
|
||||||
item['level'] = 1;
|
item['level'] = 1;
|
||||||
item['quality'] = 1;
|
item['quality'] = 2;
|
||||||
item['token_id'] = bchelper.genAirDropTokenId(airDropDate, utils.pad(seqId, 7));
|
item['token_id'] = bchelper.genAirDropTokenId(airDropDate, utils.pad(seqId, 7));
|
||||||
++seqId;
|
++seqId;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
fs.writeFileSync('1.json', utils.prettyJsonEncode(json));
|
fs.writeFileSync(`${airDropDate}.airdrop@${airDropDate}.airdrop.json`, utils.prettyJsonEncode(json));
|
||||||
jsonToCsv(
|
jsonToCsv(
|
||||||
airDropDate + '.dirdop.csv',
|
airDropDate + '.airdrop.csv',
|
||||||
json,
|
json,
|
||||||
[
|
[
|
||||||
'address',
|
'address',
|
||||||
@ -58,4 +59,3 @@ jsonToCsv(
|
|||||||
'quality',
|
'quality',
|
||||||
'token_id'
|
'token_id'
|
||||||
]);
|
]);
|
||||||
console.log(utils.prettyJsonEncode(json));
|
|
||||||
|
6978
server/web3tools/package-lock.json
generated
6978
server/web3tools/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "web3tools",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"description": "",
|
|
||||||
"private": true,
|
|
||||||
"scripts": {},
|
|
||||||
"dependencies": {
|
|
||||||
"@metamask/eth-sig-util": "^4.0.0",
|
|
||||||
"common": "file:../common",
|
|
||||||
"csv": "^6.3.1",
|
|
||||||
"express": "^4.17.2",
|
|
||||||
"j7": "file:../../third_party/j7",
|
|
||||||
"log4js": "~6.3.0",
|
|
||||||
"mysql": "~2.18.1",
|
|
||||||
"web3": "^1.6.1"
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user