File tree 3 files changed +6
-6
lines changed
pragma-node/src/handlers/entries
3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ use super::GetEntryParams;
18
18
( status = 200 , description = "Get median entry successfuly" , body = [ GetEntryResponse ] )
19
19
) ,
20
20
params(
21
- ( "quote" = String , Path , description = "Quote Asset" ) ,
22
21
( "base" = String , Path , description = "Base Asset" ) ,
22
+ ( "quote" = String , Path , description = "Quote Asset" ) ,
23
23
GetEntryParams ,
24
24
) ,
25
25
) ]
@@ -30,7 +30,7 @@ pub async fn get_entry(
30
30
) -> Result < Json < GetEntryResponse > , EntryError > {
31
31
tracing:: info!( "Received get entry request for pair {:?}" , pair) ;
32
32
// Construct pair id
33
- let pair_id = currency_pair_to_pair_id ( & pair. 1 , & pair. 0 ) ;
33
+ let pair_id = currency_pair_to_pair_id ( & pair. 0 , & pair. 1 ) ;
34
34
35
35
let now = chrono:: Utc :: now ( ) . naive_utc ( ) . timestamp_millis ( ) as u64 ;
36
36
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ use super::GetEntryParams;
17
17
( status = 200 , description = "Get OHLC data successfuly" , body = [ GetOHLCResponse ] )
18
18
) ,
19
19
params(
20
- ( "quote" = String , Path , description = "Quote Asset" ) ,
21
20
( "base" = String , Path , description = "Base Asset" ) ,
21
+ ( "quote" = String , Path , description = "Quote Asset" ) ,
22
22
GetEntryParams ,
23
23
) ,
24
24
) ]
@@ -29,7 +29,7 @@ pub async fn get_ohlc(
29
29
) -> Result < Json < GetOHLCResponse > , EntryError > {
30
30
tracing:: info!( "Received get entry request for pair {:?}" , pair) ;
31
31
// Construct pair id
32
- let pair_id = currency_pair_to_pair_id ( & pair. 1 , & pair. 0 ) ;
32
+ let pair_id = currency_pair_to_pair_id ( & pair. 0 , & pair. 1 ) ;
33
33
34
34
let now = chrono:: Utc :: now ( ) . naive_utc ( ) . timestamp_millis ( ) as u64 ;
35
35
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ use crate::infra::repositories::entry_repository::MedianEntry;
6
6
/// Converts a currency pair to a pair id.
7
7
///
8
8
/// e.g "btc" and "usd" to "BTC/USD"
9
- pub ( crate ) fn currency_pair_to_pair_id ( quote : & str , base : & str ) -> String {
10
- format ! ( "{}/{}" , quote . to_uppercase( ) , base . to_uppercase( ) )
9
+ pub ( crate ) fn currency_pair_to_pair_id ( base : & str , quote : & str ) -> String {
10
+ format ! ( "{}/{}" , base . to_uppercase( ) , quote . to_uppercase( ) )
11
11
}
12
12
13
13
/// Computes the median price and time from a list of entries.
You can’t perform that action at this time.
0 commit comments