Merge pull request #444 from nodar-chkuaselidze/wallet-api/create-tx
Allow optional signing in createTX http endpoint
This commit is contained in:
commit
fe340265c8
@ -465,6 +465,7 @@ class HTTP extends Server {
|
|||||||
const valid = Validator.fromRequest(req);
|
const valid = Validator.fromRequest(req);
|
||||||
const passphrase = valid.str('passphrase');
|
const passphrase = valid.str('passphrase');
|
||||||
const outputs = valid.array('outputs', []);
|
const outputs = valid.array('outputs', []);
|
||||||
|
const sign = valid.bool('sign', true);
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
rate: valid.u64('rate'),
|
rate: valid.u64('rate'),
|
||||||
@ -499,7 +500,8 @@ class HTTP extends Server {
|
|||||||
|
|
||||||
const tx = await req.wallet.createTX(options);
|
const tx = await req.wallet.createTX(options);
|
||||||
|
|
||||||
await req.wallet.sign(tx, passphrase);
|
if (sign)
|
||||||
|
await req.wallet.sign(tx, passphrase);
|
||||||
|
|
||||||
res.json(200, tx.getJSON(this.network));
|
res.json(200, tx.getJSON(this.network));
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user