Asset Price Change

+1 vote

HI multichain team!
i want to ask something about the asset issuance as when someone create asset then user will put the price of asset with respect to asset unit,but when a creator will send this asset to anyone then how we can update the value of price for asset on multichain.Is there any way?

var getDetail = async(name) => {

return new Promise(async(resolve) => {

await multichain.listAssets({ asset: name }, (err, res) => {

if (res) {

console.log(res)

resolve({ success: true, result: { name: res[0].name, issuetxid: res[0].issuetxid, detail: res[0].details } });

} else {

console.log(err)

resolve({ success: false, message: err })

}

 

})

 

})

}
at now am gettting detail of asset from this function

 

asked Jul 24, 2020 by Muzammil

1 Answer

0 votes

The question is what you want the price of the asset to do. If it's just a piece of information that doesn't affect blockchain transaction validity, you could have each transaction that transfers the asset also write the price to a stream as a regular stream item. There are various ways to do this but sendwithdata is probably the easiest.

If appropriate  and necessary you could also use a stream filter to ensure that an item can only be written to this stream if it is actually making a transfer of the asset.

answered Jul 27, 2020 by MultiChain
...