Skip to content

Commit cfd14a2

Browse files
committed
clean up
1 parent c97ce7b commit cfd14a2

File tree

1 file changed

+14
-31
lines changed

1 file changed

+14
-31
lines changed

packages/bitcore-node/src/modules/ripple/api/transform.ts

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -38,37 +38,20 @@ export class RippleWalletTransactions extends Transform {
3838
}
3939
for (const output of changes[address]) {
4040
if (sending) {
41-
if (!receiving) {
42-
this.push(
43-
JSON.stringify({
44-
id: tx.hash,
45-
txid: tx.hash,
46-
fee: transaction.fee * 1e6,
47-
size: 0,
48-
category: 'send',
49-
satoshis: -1 * Number(output.value) * 1e6,
50-
height: transaction.blockHeight,
51-
address,
52-
outputIndex: changed.indexOf(address),
53-
blockTime: transaction.blockTimeNormalized
54-
}) + '\n'
55-
);
56-
} else {
57-
this.push(
58-
JSON.stringify({
59-
id: tx.hash,
60-
txid: tx.hash,
61-
fee: transaction.fee * 1e6,
62-
size: 0,
63-
category: 'move',
64-
satoshis: -1 * Number(output.value) * 1e6,
65-
height: transaction.blockHeight,
66-
address,
67-
outputIndex: changed.indexOf(address),
68-
blockTime: transaction.blockTimeNormalized
69-
}) + '\n'
70-
);
71-
}
41+
this.push(
42+
JSON.stringify({
43+
id: tx.hash,
44+
txid: tx.hash,
45+
fee: transaction.fee * 1e6,
46+
size: 0,
47+
category: receiving ? 'move' : 'send',
48+
satoshis: -1 * Number(output.value) * 1e6,
49+
height: transaction.blockHeight,
50+
address,
51+
outputIndex: changed.indexOf(address),
52+
blockTime: transaction.blockTimeNormalized
53+
}) + '\n'
54+
);
7255
if (transaction.fee > 0) {
7356
this.push(
7457
JSON.stringify({

0 commit comments

Comments
 (0)