File tree 2 files changed +8
-6
lines changed
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 5
5
* @module response/bybit/aggregate
6
6
*/
7
7
8
+ import { successfulJson } from '#lib/fetch.mjs' ;
8
9
import { fileReadJson } from '#lib/file_system.mjs' ;
9
10
10
11
import aggregate from '../aggregate.mjs' ;
@@ -18,12 +19,12 @@ import aggregate from '../aggregate.mjs';
18
19
const bybitAggregate = ( directory , fileName ) => {
19
20
const { bybit } = global . apiTools ,
20
21
endpoint = directory . toUpperCase ( ) ,
21
- json = fileReadJson ( 'response/bybit/snapshot/' + directory , fileName ) ,
22
- data = json . CREATED ?. json || json . OK ?. json . result . rows ,
22
+ fileData = fileReadJson ( 'response/bybit/snapshot/' + directory , fileName ) ,
23
+ json = /** @type { { result: { rows: object }} } */ ( successfulJson ( fileData ) ) . result . rows ,
23
24
file = aggregate (
24
25
bybit ,
25
26
endpoint ,
26
- data ,
27
+ json ,
27
28
{
28
29
currencies : ( item ) => ( {
29
30
chains : item . chains . map ( ( item ) => ( {
Original file line number Diff line number Diff line change 5
5
* @module response/coinbase/aggregate
6
6
*/
7
7
8
+ import { successfulJson } from '#lib/fetch.mjs' ;
8
9
import { fileReadJson } from '#lib/file_system.mjs' ;
9
10
10
11
import aggregate from '../aggregate.mjs' ;
@@ -18,12 +19,12 @@ import aggregate from '../aggregate.mjs';
18
19
const coinbaseAggregate = ( directory , fileName ) => {
19
20
const { coinbase } = global . apiTools ,
20
21
endpoint = directory . toUpperCase ( ) ,
21
- json = fileReadJson ( 'response/coinbase/snapshot/' + directory , fileName ) ,
22
- data = json . CREATED ?. json || json . OK ?. json . data ,
22
+ fileData = fileReadJson ( 'response/coinbase/snapshot/' + directory , fileName ) ,
23
+ json = /** @type { { data: object } } */ ( successfulJson ( fileData ) ) . data ,
23
24
file = aggregate (
24
25
coinbase ,
25
26
endpoint ,
26
- data ,
27
+ json ,
27
28
{
28
29
currencies : ( item ) => ( {
29
30
asset_id : item [ 'asset_id' ] ,
You can’t perform that action at this time.
0 commit comments