1
This commit is contained in:
parent
6e2d8196c9
commit
f93de9047b
@ -6,6 +6,7 @@ const BC_NFT_BLIND_BOX = 4;
|
||||
const BC_NFT_FRAGMENT = 5;
|
||||
const BC_NFT_CLAIM_BOX = 6;
|
||||
const BC_NFT_GENESIS = 7;
|
||||
const BC_NFT_PLANET = 8;
|
||||
|
||||
const BC_FUNC_CREATION = 1;
|
||||
const BC_FUNC_GUILD = 3;
|
||||
@ -30,6 +31,7 @@ exports.BC_NFT_BLIND_BOX = BC_NFT_BLIND_BOX;
|
||||
exports.BC_NFT_FRAGMENT = BC_NFT_FRAGMENT;
|
||||
exports.BC_NFT_CLAIM_BOX = BC_NFT_CLAIM_BOX;
|
||||
exports.BC_NFT_GENESIS = BC_NFT_GENESIS;
|
||||
exports.BC_NFT_PLANET = BC_NFT_PLANET;
|
||||
|
||||
exports.BC_FUNC_CREATION = BC_FUNC_CREATION;
|
||||
exports.BC_FUNC_GUILD = BC_FUNC_GUILD;
|
||||
|
64
server/web3dbspider/services/events/PLANET/transfer.js
Normal file
64
server/web3dbspider/services/events/PLANET/transfer.js
Normal file
@ -0,0 +1,64 @@
|
||||
const log = require('j7/log');
|
||||
const utils = require('j7/utils');
|
||||
const bcutils = require('j7/bcutils');
|
||||
const bcconst = require('common/bcconst');
|
||||
const constant = require('common/constant');
|
||||
const BaseEventProcess = require('../common/BaseEventProcess');
|
||||
|
||||
class Transfer extends BaseEventProcess {
|
||||
|
||||
async start() {
|
||||
const returnValues = this.getReturnValues();
|
||||
//if (bcutils.isSysAddress(returnValues['from'])) {
|
||||
await this.mint(returnValues['from'],
|
||||
returnValues['to'],
|
||||
returnValues['tokenId']
|
||||
);
|
||||
//}
|
||||
/*
|
||||
await this.add721NftRefresh
|
||||
(
|
||||
this.getNetId(),
|
||||
this.getContractAddress(),
|
||||
this.getContractName(),
|
||||
returnValues['tokenId']
|
||||
);*/
|
||||
await this.markOk();
|
||||
}
|
||||
|
||||
async mint(from, to, tokenId) {
|
||||
const logHead = this.genLogHead(' mint ');
|
||||
const nowTime = utils.getUtcTime();
|
||||
const fieldList = [
|
||||
['token_id', tokenId],
|
||||
['token_type', bcconst.BC_NFT_PLANET],
|
||||
['item_id', tokenId],
|
||||
['owner_address', bcutils.toNormalAddress(to)],
|
||||
['creator_address', bcutils.toNormalAddress(to)],
|
||||
['confirm_block_number', this.getBlockNumber()],
|
||||
['net_id', this.getNetId()],
|
||||
['contract_address', this.getContractAddress()],
|
||||
['createtime', nowTime],
|
||||
['modifytime', nowTime],
|
||||
];
|
||||
const {err} = await this.bcNftDbConn(
|
||||
'upsert',
|
||||
't_nft',
|
||||
[
|
||||
['token_id', tokenId],
|
||||
['net_id', this.getNetId()],
|
||||
['contract_address', this.getContractAddress()],
|
||||
],
|
||||
[
|
||||
['owner_address', bcutils.toNormalAddress(to)],
|
||||
],
|
||||
fieldList
|
||||
);
|
||||
if (err) {
|
||||
this.throwError('mintNft ' + err);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Transfer;
|
@ -22,6 +22,7 @@ async function init() {
|
||||
await add('CHIP.Transfer', 'CHIP/transfer');
|
||||
await add('Gacha.Transfer', 'Gacha/transfer');
|
||||
await add('Genesis.Transfer', 'Genesis/transfer');
|
||||
await add('PLANET.Transfer', 'PLANET/transfer');
|
||||
await add('UserMinterFactory.TokenMinted', 'UserMinterFactory/activate721nft');
|
||||
await add('BENftMarket.SellOrder', 'BENftMarket/sell_order');
|
||||
await add('BENftMarket.CancelOrder', 'BENftMarket/cancel_order');
|
||||
|
Loading…
x
Reference in New Issue
Block a user