Skip to content

Commit

Permalink
getIsCexLiquidityAvailable
Browse files Browse the repository at this point in the history
  • Loading branch information
kigastu committed May 2, 2024
1 parent 565a22d commit cf6dd96
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.20.85",
"version": "0.20.86",
"description": "Orion Protocol SDK",
"main": "./lib/index.cjs",
"module": "./lib/index.js",
Expand Down
15 changes: 15 additions & 0 deletions src/services/Aggregator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class Aggregator {
this.getPoolReserves = this.getPoolReserves.bind(this);
this.getVersion = this.getVersion.bind(this);
this.getPrices = this.getPrices.bind(this);
this.getIsCexLiquidityAvailable = this.getIsCexLiquidityAvailable.bind(this);
}

get basicAuthHeaders() {
Expand Down Expand Up @@ -390,6 +391,20 @@ class Aggregator {
return fetchWithValidation(url.toString(), atomicSwapHistorySchema, { headers: this.basicAuthHeaders });
};

getIsCexLiquidityAvailable = (
assetIn: string,
assetOut: string,
) => {
const url = new URL(`${this.apiUrl}/api/v1/pairs/cex/liquidity/${assetIn}/${assetOut}`);

return fetchWithValidation(
url.toString(),
z.boolean(),
{ headers: this.basicAuthHeaders },
errorSchema,
);
};

// private encode_utf8(s: string) {
// return unescape(encodeURIComponent(s));
// }
Expand Down

0 comments on commit cf6dd96

Please sign in to comment.