spee.ch/server/models/utils/createClaimRecordData.js
2018-07-26 17:57:26 -07:00

39 lines
673 B
JavaScript

const createClaimRecordDataAfterPublish = (certificateId, channelName, fileName, fileType, publishParams, publishResults) => {
const {
name,
metadata: {
title,
description,
thumbnail,
nsfw,
},
claim_address: address,
bid: amount,
} = publishParams;
const {
claim_id: claimId,
txid,
nout,
} = publishResults;
return {
name,
claimId,
title,
description,
address,
thumbnail,
outpoint : `${txid}:${nout}`,
height : 0,
contentType: fileType,
nsfw,
amount,
certificateId,
channelName,
};
};
module.exports = {
createClaimRecordDataAfterPublish,
};