Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions lib/wallet/rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2717,7 +2717,7 @@ class RPC extends RPCBase {
async sendBatch(args, help) {
const [actions, options] = this._validateBatch(args, help, 'sendbatch');
const wallet = this.wallet;
const tx = await wallet.sendBatch(actions, options);
const {tx} = await wallet.sendBatch(actions, options);

return tx.getJSON(this.network);
}
Expand All @@ -2727,7 +2727,7 @@ class RPC extends RPCBase {
options.paths = true;

const wallet = this.wallet;
const mtx = await wallet.createBatch(actions, options);
const {mtx} = await wallet.createBatch(actions, options);

return mtx.getJSON(this.network);
}
Expand Down Expand Up @@ -2762,7 +2762,7 @@ class RPC extends RPCBase {
'NONE action requires 2 arguments: address, value'
);
const {addr, value} = this._validateSendToAddress(action);
actions.push([type, addr, value]);
actions.push({ type: type, args: [addr, value] });
break;
}
case 'OPEN': {
Expand All @@ -2771,7 +2771,7 @@ class RPC extends RPCBase {
'OPEN action requires 1 argument: name'
);
const {name} = this._validateOpen(action);
actions.push([type, name]);
actions.push({ type: type, args: [name] });
break;
}
case 'BID': {
Expand All @@ -2780,7 +2780,7 @@ class RPC extends RPCBase {
'BID action requires 3 arguments: name, bid, value'
);
const {name, bid, value} = this._validateBid(action);
actions.push([type, name, bid, value]);
actions.push({ type: type, args: [name, bid, value] });
break;
}
case 'REVEAL': {
Expand All @@ -2790,9 +2790,9 @@ class RPC extends RPCBase {
);
const {name} = this._validateReveal(action);
if (name)
actions.push([type, name]);
actions.push({ type: type, args: [name] });
else
actions.push([type]);
actions.push({ type: type });
break;
}
case 'REDEEM': {
Expand All @@ -2802,9 +2802,9 @@ class RPC extends RPCBase {
);
const {name} = this._validateRedeem(action);
if (name)
actions.push([type, name]);
actions.push({ type: type, args: [name] });
else
actions.push([type]);
actions.push({ type: type });
break;
}
case 'UPDATE': {
Expand All @@ -2813,7 +2813,7 @@ class RPC extends RPCBase {
'UPDATE action requires 2 arguments: name, data'
);
const {name, resource} = this._validateUpdate(action);
actions.push([type, name, resource]);
actions.push({ type: type, args: [name, resource] });
break;
}
case 'RENEW': {
Expand All @@ -2823,9 +2823,9 @@ class RPC extends RPCBase {
);
if (action.length === 1) {
const {name} = this._validateRenewal(action);
actions.push([type, name]);
actions.push({ type: type, args: [name] });
} else {
actions.push([type]);
actions.push({ type: type });
}
break;
}
Expand All @@ -2835,7 +2835,7 @@ class RPC extends RPCBase {
'TRANSFER action requires 2 arguments: name, address'
);
const {name, address} = this._validateTransfer(action);
actions.push([type, name, address]);
actions.push({ type: type, args: [name, address] });
break;
}
case 'FINALIZE': {
Expand All @@ -2845,9 +2845,9 @@ class RPC extends RPCBase {
);
if (action.length === 1) {
const {name} = this._validateFinalize(action);
actions.push([type, name]);
actions.push({ type: type, args: [name] });
} else {
actions.push([type]);
actions.push({ type: type });
}
break;
}
Expand All @@ -2857,7 +2857,7 @@ class RPC extends RPCBase {
'CANCEL action requires 1 argument: name'
);
const {name} = this._validateCancel(action);
actions.push([type, name]);
actions.push({ type: type, args: [name] });
break;
}
case 'REVOKE': {
Expand All @@ -2866,7 +2866,7 @@ class RPC extends RPCBase {
'REVOKE action requires 1 argument: name'
);
const {name} = this._validateRevoke(action);
actions.push([type, name]);
actions.push({ type: type, args: [name] });
break;
}
default:
Expand Down
Loading