wallet-http: sign parameter to create transaction without signatures.
This commit is contained in:
parent
f24a9b674f
commit
1b92e7b4ea
@ -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