mnsig - transaction cosign
var mnsig = require('mnsig-js-client');
// Adjust all these to match your data.
var credentials = {
instance: 'instance name',
apiToken: 'abctoken',
};
var wallet = 'wallet name';
var localPriv = 'xprv...';
// In this example a specific proposal id will be cosigned,
// change the next value so it matches the one you're interested.
var proposalId = 5;
var client = new mnsig.Client();
client.token = credentials.apiToken;
client.instance = credentials.instance;
client.getProposal({wallet: wallet, id: proposalId}, function(err, json) {
if (err) {
console.log('getProposal failed:', err);
return;
}
var proposal = json;
client.localSign(proposal, localPriv, function(err, json) {
if (err) {
console.log('localSign failed:', err);
return;
}
console.log('signed proposal', json);
});
});
console.log('hi');
no comments