Adde getPrices to aggregator

This commit is contained in:
Aleksandr Kraiz
2023-07-28 13:38:46 +04:00
parent 1e9c25887b
commit 2864129baa
2 changed files with 13 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.19.38",
"version": "0.19.39",
"description": "Orion Protocol SDK",
"main": "./lib/index.cjs",
"module": "./lib/index.js",

View File

@@ -285,6 +285,18 @@ class Aggregator {
);
};
getPrices = (assetPair: string, includePools: boolean) => {
const url = new URL(`${this.apiUrl}/api/v1/prices/`);
url.searchParams.append('assetPair', assetPair);
url.searchParams.append('includePools', includePools.toString());
return fetchWithValidation(
url.toString(),
z.number(),
{ headers: this.basicAuthHeaders },
errorSchema,
);
};
getLockedBalance = (address: string, currency: string) => {
const url = new URL(`${this.apiUrl}/api/v1/address/balance/reserved/${currency}`);
url.searchParams.append('address', address);