Skip to content

Commit

Permalink
Merge pull request #1013 from dfinity/mraszyk/coinbase-api
Browse files Browse the repository at this point in the history
fix: coinbase API
  • Loading branch information
letmejustputthishere authored Oct 3, 2024
2 parents 3a7baf2 + 1ef48a7 commit 8f12522
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion motoko/send_http_get/src/send_http_get_backend/main.mo
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ actor {
let ONE_MINUTE : Nat64 = 60;
let start_timestamp : Types.Timestamp = 1682978460; //May 1, 2023 22:01:00 GMT
let end_timestamp : Types.Timestamp = 1682978520;//May 1, 2023 22:02:00 GMT
let host : Text = "api.pro.coinbase.com";
let host : Text = "api.exchange.coinbase.com";
let url = "https://" # host # "/products/ICP-USD/candles?start=" # Nat64.toText(start_timestamp) # "&end=" # Nat64.toText(start_timestamp) # "&granularity=" # Nat64.toText(ONE_MINUTE);

// 2.2 prepare headers for the system http_request call
Expand Down
4 changes: 2 additions & 2 deletions rust/send_http_get/src/send_http_get_backend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async fn get_icp_usd_exchange() -> String {
type Timestamp = u64;
let start_timestamp: Timestamp = 1682978460; //May 1, 2023 22:01:00 GMT
let seconds_of_time: u64 = 60; //we start with 60 seconds
let host = "api.pro.coinbase.com";
let host = "api.exchange.coinbase.com";
let url = format!(
"https://{}/products/ICP-USD/candles?start={}&end={}&granularity={}",
host,
Expand Down Expand Up @@ -168,4 +168,4 @@ fn transform(raw: TransformArgs) -> HttpResponse {
ic_cdk::api::print(format!("Received an error from coinbase: err = {:?}", raw));
}
res
}
}

0 comments on commit 8f12522

Please sign in to comment.