issueFrom - nodejs function is not working

+1 vote
The following nodejs api function returns  always

{ code: -1, message: 'value is type null, expected str' },

I have provided all the required values in the function that are not null.. Could you please check what is missing here..

1. Both the addresses are having issue permission

2. Getting the same response from Windows as well as in Ubuntu that running multichain alpha29 and beta versions respectively.

3. Command line issuefrom command works fine with these values.

// code start

address1 = "1UEH7p5WpsF8AQSCXnsJs7Jn578Ki71dyHjRTP";
address2 = "1Gh82xnL9L3udKJmHtPzjydorKCPXHNSRv8vEM";
asset_name = "gold";  
asset_qty = 1000;
asset_units = 1.0;
 
multichain.issueFrom({from_address: address1, to_address: address2, asset: asset_name, qty: asset_qty, units: asset_units }, (err, res) => {
                if(err){   
                                   console.log(err);
                }  
 });

returns:-

{ code: -1, message: 'value is type null, expected str' },
asked Apr 6, 2017 by saravana
edited Apr 6, 2017 by saravana

1 Answer

0 votes

We can't take direct responsibility for third party libraries, so the best way to find the problem is to add some debugging logic to output the exact JSON-RPC command sent by the nodejs library, and compare that to the command sent by multichain-cli. That will help you find what is being sent wrong.

answered Apr 6, 2017 by MultiChain
Thanks for the reply..

Found the issue and fixed, the parameter variables has to be  "from": and "to":  not "from_address": and "to_address":
...