I just want to distribute a "eth" values to multiple public addresses. Is it possible with current version of "web3.js"? So that metamask will ask only a single time to approve a transaction.
Edit:-
initContract: function() {
$.getJSON('PayContract.json', function(data) {
var payContract = data;
App.contracts.PayContract = TruffleContract(payContract);
App.contracts.PayContract.setProvider(App.web3Provider);
});
},
refundButtonOnClick : function (event) {
console.log('refund button pressed');
var mmPayToClients;
var payees = [0x****BEf57,0x***a8BEf57,0x**7];
var values = [0.5,1.0,0.5];
App.contracts.PayContract.deployed().then(function(instance)
{
mmPayToClients = instance;
return mmPayToClients.pay(payees,values);
}).then(function(result) {
console.log(result.message);
}).catch(function(err) {
console.log(err.message);
});
}