Preparelockunspent

+1 vote
I have been able to successfully write the code to execute the atomic transactions described in your paper. Next I would like to generate a atomic transaction multiple assets or tokens in the preparelockunspent/createrawexchange. For example,

preparelockunspent 1... {"JPY":10500}, {"CAN":1000}

I would like to sell 10,500 JPY and 1,000  CAN

createrawtransaction prepareTxid prepareVout {"USD":100}, {"RUB":20000}

I would like to receive 100 USD and 20000 RUB for the assets defined in the prepare statement. Furthermore, as discussed in your paper, I would like to be able to support three-way atomic transactions in this manner. The documentation is not clear if this possible with the "amounts" variable used in each command. Any suggestions will be greatly appreciated.
asked Apr 7, 2022 by eetiwah

1 Answer

+1 vote

Yes, this is certainly possible. See this link for all the different ways in which you can specify multiple amounts:

https://www.multichain.com/developers/json-rpc-api/#amounts

Following your example:

{"JPY":10500,"CAN":1000}

Remember to include this JSON structure in single quotes if you're using the command line.

answered Apr 8, 2022 by MultiChain
I guess I should have read the last two pages of the API doc! Thanks!
...