Appendrawexchange

+1 vote
Dear Team

 

I get the following error:

error code: -707
error message:
Only pay-to-keyhash addresses are supported in exchange; Output: 1

 

Steps followed:

Node1:

issue ,preparelockunspentfrom, createrawexchange, appendrawdata, signrawtransaction

 

On node 2

issue, preparelockunspentfrom, appendrawexchange,

I get the following error:

error code: -707
error message:
Only pay-to-keyhash addresses are supported in exchange; Output: 1

 

Please advise.
asked May 25, 2018 by dannydias

1 Answer

0 votes

You can't include metadata in an additional output of an exchange transaction, unless that transaction has already been balanced. So you have two options here:

  1. Add the metadata in the last stage, which balances the exchange. You can use the completerawexchange API to make this easy.
  2. If you are using MultiChain 2.0 alpha 2, you can embed metadata within the same transaction output as represents the 'ask' of the change. Something like this:
createrawexchange 7b899fb5050d067bc2fce644dc34bedf9006737779bdb2a37aeb30ae74779127 0 '{"asset1":100,"data":"012345"}'
answered May 25, 2018 by MultiChain
...