From 1ef48a7c5bd4f668f94258e6aad06e9899286f33 Mon Sep 17 00:00:00 2001 From: Martin Raszyk Date: Thu, 3 Oct 2024 07:25:48 +0200 Subject: [PATCH] fix: coinbase API --- motoko/send_http_get/src/send_http_get_backend/main.mo | 2 +- rust/send_http_get/src/send_http_get_backend/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/motoko/send_http_get/src/send_http_get_backend/main.mo b/motoko/send_http_get/src/send_http_get_backend/main.mo index b8851fc0b..ec1e96226 100644 --- a/motoko/send_http_get/src/send_http_get_backend/main.mo +++ b/motoko/send_http_get/src/send_http_get_backend/main.mo @@ -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 diff --git a/rust/send_http_get/src/send_http_get_backend/src/lib.rs b/rust/send_http_get/src/send_http_get_backend/src/lib.rs index a8aba5c09..50cc063b2 100644 --- a/rust/send_http_get/src/send_http_get_backend/src/lib.rs +++ b/rust/send_http_get/src/send_http_get_backend/src/lib.rs @@ -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, @@ -168,4 +168,4 @@ fn transform(raw: TransformArgs) -> HttpResponse { ic_cdk::api::print(format!("Received an error from coinbase: err = {:?}", raw)); } res -} \ No newline at end of file +}