mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-17 00:31:34 +03:00
getIsCexLiquidityAvailable
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.20.85",
|
||||
"version": "0.20.86",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.20.85",
|
||||
"version": "0.20.86",
|
||||
"hasInstallScript": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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() {
|
||||
@@ -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));
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user