Extension to json-rpc calls for custom data and question on accepted types

+1 vote

Going through various calls there are times when the custom data is JSON or data-hex|object is there a reason for this in these particular calls? I am having an issue with a particular call.

Would it be possible to extend the call for 'issueFrom' to not only allow

({"custom-field-1":"x",...}) as custom data but to accept data-hex|object as well as an extension to this API call?

I would like to pass a hex object to this call and trying to use generic functions in my solution but i end up having two ways to send data to the API.


asked Sep 8, 2017 by RobertJ

1 Answer

+1 vote
Best answer

For now the issuefrom API is designed for per-asset metadata only, which has a key-value structure (text-only, not full JSON).

So you have two good options – either pass the hex object as a field within this key-value structure, but this only works if the hex item is small (say up to 3 kB to leave space for other metadata fields within the 4 kB limit).

Otherwise, use createrawsendfrom to perform the issuance together with an additional raw metadata field in a single transaction. To see an example, you can follow the tutorial for issuance with raw transactions ( https://www.multichain.com/developers/raw-transactions/ ) and add an extra item to the data parameter containing the raw hex. You can also look at how we allow a document to be uploaded together with an asset issuance in the MultiChain Web Demo: https://github.com/MultiChain/multichain-web-demo/blob/master/page-issue.php

answered Sep 9, 2017 by MultiChain
selected Sep 11, 2017 by RobertJ