Compatibility

This commit is contained in:
Aleksandr Kraiz
2023-08-01 22:18:18 +04:00
parent 96ec616be7
commit cd3eb34b11
3 changed files with 10 additions and 2 deletions

View File

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

View File

@@ -84,6 +84,7 @@ class BlockchainService {
this.getUserEarned = this.getUserEarned.bind(this);
this.getPoolsV3Info = this.getPoolsV3Info.bind(this);
this.getHistory = this.getHistory.bind(this);
this.getPrices = this.getPrices.bind(this);
this.getPricesWithQuoteAsset = this.getPricesWithQuoteAsset.bind(this);
this.getTokensFee = this.getTokensFee.bind(this);
this.getGasPriceWei = this.getGasPriceWei.bind(this);
@@ -215,8 +216,14 @@ class BlockchainService {
{ headers: this.basicAuthHeaders }
);
getPricesWithQuoteAsset = () => fetchWithValidation(
getPrices = () => fetchWithValidation(
`${this.apiUrl}/api/prices`,
z.record(z.string()).transform(makePartial),
{ headers: this.basicAuthHeaders }
);
getPricesWithQuoteAsset = () => fetchWithValidation(
`${this.apiUrl}/api/quotedPrices`,
pricesWithQuoteAssetSchema,
{ headers: this.basicAuthHeaders }
);

View File

@@ -3,5 +3,6 @@ import { makePartial } from '../../../utils/index.js';
export const pricesWithQuoteAssetSchema = z.object({
quoteAsset: z.string(),
quoteAssetAddress: z.string(),
prices: z.record(z.string()).transform(makePartial)
});