mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-25 15:17:40 +03:00
Merge remote-tracking branch origin/main into OP-5070-visible-assets
This commit is contained in:
@@ -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