Skip to content

Commit

Permalink
fix: Updating the Coinbase URL (#272)
Browse files Browse the repository at this point in the history
Coinbase returns a "Coinbase Pro API is deprecated" error.
The correct URL is now `api.exchange.coinbase.com` (instead of
`api.pro.coinbase.com`).
  • Loading branch information
THLO authored Nov 5, 2024
1 parent 8ee6522 commit e466467
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ runs:
outputs: ./out

- name: "Upload wasm module"
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Exchange Rate Canister WASM Module
path: ./out/xrc.wasm.gz
path: ./out/xrc.wasm.gz
4 changes: 2 additions & 2 deletions src/xrc/src/exchanges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ type CoinbaseResponse = Vec<(u64, f64, f64, f64, f64, f64)>;

impl IsExchange for Coinbase {
fn get_base_url(&self) -> &str {
"https://api.pro.coinbase.com/products/BASE_ASSET-QUOTE_ASSET/candles?granularity=60&start=START_TIME&end=END_TIME"
"https://api.exchange.coinbase.com/products/BASE_ASSET-QUOTE_ASSET/candles?granularity=60&start=START_TIME&end=END_TIME"
}

fn extract_rate(&self, bytes: &[u8]) -> Result<u64, ExtractError> {
Expand Down Expand Up @@ -611,7 +611,7 @@ mod test {

let coinbase = Coinbase;
let query_string = coinbase.get_url("btc", "icp", timestamp);
assert_eq!(query_string, "https://api.pro.coinbase.com/products/BTC-ICP/candles?granularity=60&start=1661523960&end=1661523960");
assert_eq!(query_string, "https://api.exchange.coinbase.com/products/BTC-ICP/candles?granularity=60&start=1661523960&end=1661523960");

let kucoin = KuCoin;
let query_string = kucoin.get_url("btc", "icp", timestamp);
Expand Down

0 comments on commit e466467

Please sign in to comment.