File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -669,6 +669,7 @@ exports.getPrices = async () => {
669
669
rp . request ( options2 ) ,
670
670
] )
671
671
} catch ( error ) {
672
+ console . log ( { error } )
672
673
throw new Error ( 'Error fetching prices' )
673
674
}
674
675
@@ -774,7 +775,6 @@ exports.getPrices = async () => {
774
775
urls : '' ,
775
776
network : '' ,
776
777
}
777
- delete finalMap [ token . id ] . symbol
778
778
} )
779
779
780
780
const networksContract = await getNetworkByToken ( idcrypto . join ( ',' ) )
@@ -807,10 +807,17 @@ exports.getPrices = async () => {
807
807
finalMap [ token . symbol ] . decimals = token . platform . decimals
808
808
}
809
809
}
810
- prices = { data : finalMap , date : Date . now ( ) }
810
+ let newCryptoPrices = { }
811
+ for ( const key in finalMap ) {
812
+ if ( finalMap . hasOwnProperty ( key ) ) {
813
+ const crypto = finalMap [ key ]
814
+ const symbol = crypto . symbol
815
+ newCryptoPrices [ symbol ] = crypto
816
+ }
817
+ }
818
+ prices = { data : newCryptoPrices , date : Date . now ( ) }
811
819
cache . put ( 'prices' , prices )
812
-
813
- return finalMap
820
+ return newCryptoPrices
814
821
}
815
822
} catch ( err ) {
816
823
throw new Error ( 'Error fetching prices ' )
You can’t perform that action at this time.
0 commit comments