mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-29 09:07:59 +03:00
merged with develop
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
governancePoolsSchema,
|
||||
governancePoolSchema,
|
||||
governanceChainsInfoSchema,
|
||||
pricesWithQuoteAssetSchema,
|
||||
} from './schemas/index.js';
|
||||
import type redeemOrderSchema from '../Aggregator/schemas/redeemOrderSchema.js';
|
||||
import { sourceAtomicHistorySchema, targetAtomicHistorySchema } from './schemas/atomicHistorySchema.js';
|
||||
@@ -84,6 +85,7 @@ class BlockchainService {
|
||||
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);
|
||||
this.checkFreeRedeemAvailable = this.checkFreeRedeemAvailable.bind(this);
|
||||
@@ -220,6 +222,12 @@ class BlockchainService {
|
||||
{ headers: this.basicAuthHeaders }
|
||||
);
|
||||
|
||||
getPricesWithQuoteAsset = () => fetchWithValidation(
|
||||
`${this.apiUrl}/api/quotedPrices`,
|
||||
pricesWithQuoteAssetSchema,
|
||||
{ headers: this.basicAuthHeaders }
|
||||
);
|
||||
|
||||
getTokensFee = () => fetchWithValidation(
|
||||
`${this.apiUrl}/api/tokensFee`,
|
||||
z.record(z.string()).transform(makePartial),
|
||||
|
||||
@@ -17,3 +17,4 @@ export { default as governancePoolsSchema } from './governancePoolsSchema.js';
|
||||
export { default as governancePoolSchema } from './governancePoolSchema.js';
|
||||
export { default as governanceChainsInfoSchema } from './governanceChainsInfoSchema.js';
|
||||
export { default as poolsV3InfoSchema } from './poolsV3InfoSchema.js';
|
||||
export { pricesWithQuoteAssetSchema } from './pricesWithQuoteAssetSchema.js';
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import { z } from 'zod';
|
||||
import { makePartial } from '../../../utils/index.js';
|
||||
|
||||
export const pricesWithQuoteAssetSchema = z.object({
|
||||
quoteAsset: z.string(),
|
||||
quoteAssetAddress: z.string(),
|
||||
prices: z.record(z.string()).transform(makePartial)
|
||||
});
|
||||
Reference in New Issue
Block a user