spee.ch/server/models/utils/createClaimRecordData.js

40 lines
673 B
JavaScript
Raw Normal View History

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