mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-28 00:28:04 +03:00
Adde getPrices to aggregator
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user