balanceofsatoshis 13.4.0 → 13.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/balances/get_accounting_report.js +10 -1
- package/balances/range_for_date.js +10 -3
- package/bos +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -24,6 +24,7 @@ const summaryHeadings = ['Total', 'Asset', 'Report Date', 'Total Fiat'];
|
|
|
24
24
|
{
|
|
25
25
|
category: <Accounting Category Type String>
|
|
26
26
|
[currency]: <Currency Label String>
|
|
27
|
+
[date]: <Day of Month String>
|
|
27
28
|
[fiat]: <Fiat Type String>
|
|
28
29
|
[is_csv]: <Return CSV Output Bool>
|
|
29
30
|
[is_fiat_disabled]: <Omit Fiat Conversion Bool>
|
|
@@ -50,6 +51,10 @@ module.exports = (args, cbk) => {
|
|
|
50
51
|
return cbk([400, 'ExpectedKnownAccountingRecordsCategory']);
|
|
51
52
|
}
|
|
52
53
|
|
|
54
|
+
if (!!args.date && !args.month) {
|
|
55
|
+
return cbk([400, 'ExpectedMonthForDateToGetAccountingReport']);
|
|
56
|
+
}
|
|
57
|
+
|
|
53
58
|
if (!args.lnd) {
|
|
54
59
|
return cbk([400, 'ExpectedAuthenticatedLndToGetAccountingReport']);
|
|
55
60
|
}
|
|
@@ -64,7 +69,11 @@ module.exports = (args, cbk) => {
|
|
|
64
69
|
// Get date range
|
|
65
70
|
dateRange: ['validate', ({}, cbk) => {
|
|
66
71
|
try {
|
|
67
|
-
return cbk(null, rangeForDate({
|
|
72
|
+
return cbk(null, rangeForDate({
|
|
73
|
+
date: args.date,
|
|
74
|
+
month: args.month,
|
|
75
|
+
year: args.year,
|
|
76
|
+
}));
|
|
68
77
|
} catch (err) {
|
|
69
78
|
return cbk([400, err.message]);
|
|
70
79
|
}
|
|
@@ -7,6 +7,7 @@ const {notFoundIndex} = require('./constants');
|
|
|
7
7
|
/** Get a before and after range
|
|
8
8
|
|
|
9
9
|
{
|
|
10
|
+
[date]: <Day of Month String>
|
|
10
11
|
[month]: <Month String>
|
|
11
12
|
[year]: <Year String>
|
|
12
13
|
}
|
|
@@ -20,8 +21,8 @@ const {notFoundIndex} = require('./constants');
|
|
|
20
21
|
[before]: <Before ISO 8601 Date String>
|
|
21
22
|
}
|
|
22
23
|
*/
|
|
23
|
-
module.exports = ({month, year}) => {
|
|
24
|
-
if (!year && !month) {
|
|
24
|
+
module.exports = ({date, month, year}) => {
|
|
25
|
+
if (!date && !year && !month) {
|
|
25
26
|
return {};
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -45,7 +46,13 @@ module.exports = ({month, year}) => {
|
|
|
45
46
|
[after, end].forEach(n => n.month(month));
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
if (!!
|
|
49
|
+
if (!!date) {
|
|
50
|
+
[after, end].forEach(n => n.date(date));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!!date) {
|
|
54
|
+
end.add([date].length, 'day');
|
|
55
|
+
} else if (!!month) {
|
|
49
56
|
end.add([month].length, 'months');
|
|
50
57
|
} else {
|
|
51
58
|
end.add([after].length, 'years');
|
package/bos
CHANGED
|
@@ -70,6 +70,7 @@ prog
|
|
|
70
70
|
.help(`Rate providers: ${rateProviders.join(', ')}`)
|
|
71
71
|
.help('Privacy note: this requests tx related data from third parties')
|
|
72
72
|
.option('--csv', 'Output a CSV')
|
|
73
|
+
.option('--date <day>', 'Show only records for specific date')
|
|
73
74
|
.option('--disable-fiat', 'Avoid looking up fiat conversions for records')
|
|
74
75
|
.option('--month <month>', 'Show only records for specific month', months)
|
|
75
76
|
.option('--node <node_name>', 'Get details from named node')
|
|
@@ -82,6 +83,7 @@ prog
|
|
|
82
83
|
try {
|
|
83
84
|
return balances.getAccountingReport({
|
|
84
85
|
category: args.category,
|
|
86
|
+
date: options.date,
|
|
85
87
|
is_csv: !!options.csv,
|
|
86
88
|
is_fiat_disabled: options.disableFiat,
|
|
87
89
|
lnd: (await lnd.authenticatedLnd({logger, node: options.node})).lnd,
|
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"cbor": "8.1.0",
|
|
28
28
|
"colorette": "2.0.19",
|
|
29
29
|
"crypto-js": "4.1.1",
|
|
30
|
-
"csv-parse": "5.3.
|
|
30
|
+
"csv-parse": "5.3.2",
|
|
31
31
|
"ecpair": "2.1.0",
|
|
32
32
|
"goldengate": "11.4.0",
|
|
33
33
|
"grammy": "1.12.0",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"postpublish": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t alexbosworth/balanceofsatoshis --push .",
|
|
84
84
|
"test": "tap --branches=1 --functions=1 --lines=1 --statements=1 -t 60 test/arrays/*.js test/balances/*.js test/chain/*.js test/display/*.js test/encryption/*.js test/lnd/*.js test/network/*.js test/nodes/*.js test/peers/*.js test/responses/*.js test/routing/*.js test/services/*.js test/swaps/*.js test/tags/*.js test/telegram/*.js test/wallets/*.js"
|
|
85
85
|
},
|
|
86
|
-
"version": "13.
|
|
86
|
+
"version": "13.5.0"
|
|
87
87
|
}
|