Accounts
var accounts;
// in web front-end, use an onload listener and similar to this manual flow ...
web3.eth.getAccounts(function(err,res) { accounts = res; });
var account1 = accounts[0]; // first account
var account2 = accounts[1]; // second account, if exists
...
var contract;
Contract.deployed()
.then(function(response) {
contract = response;
return contract.function(arg1, arg2, {from: account2}); // send txn from 2nd account
// in web front-end, use an onload listener and similar to this manual flow ...
web3.eth.getAccounts(function(err,res) { accounts = res; });
var account1 = accounts[0]; // first account
var account2 = accounts[1]; // second account, if exists
...
var contract;
Contract.deployed()
.then(function(response) {
contract = response;
return contract.function(arg1, arg2, {from: account2}); // send txn from 2nd account