feat: types updates

This commit is contained in:
Mikhail Gladchenko
2024-03-29 12:22:59 +00:00
parent 8c27f339fc
commit 252b7fc341
3 changed files with 10 additions and 10 deletions

View File

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

View File

@@ -1,6 +1,6 @@
import { fetchWithValidation } from 'simple-typed-fetch';
import { tickersSchema } from './schemas';
import type { tickersBaseSearchParams, tickersCategories } from '../../types';
import type { TickersBaseSearchParams, TickersCategories } from '../../types';
export class Frontage {
private readonly apiUrl: string;
@@ -20,7 +20,7 @@ export class Frontage {
sortType,
offset,
limit,
}: { searchValue: string } & tickersBaseSearchParams) => {
}: { searchValue: string } & TickersBaseSearchParams) => {
const queryParams = [
`searchValue=${encodeURIComponent(searchValue)}`,
currentNetwork !== undefined ? `&currentNetwork=${encodeURIComponent(currentNetwork)}` : '',
@@ -45,7 +45,7 @@ export class Frontage {
sortType,
offset,
limit,
}: { category: tickersCategories } & tickersBaseSearchParams) => {
}: { category: TickersCategories } & TickersBaseSearchParams) => {
const queryParams = [
`category=${encodeURIComponent(category)}`,
currentNetwork !== undefined ? `&currentNetwork=${encodeURIComponent(currentNetwork)}` : '',

View File

@@ -470,17 +470,17 @@ export type OrderSource = 'TERMINAL_MARKET' | 'TERMINAL_LIMIT' | 'SWAP_UI' | 'WI
// Frontage
export type NetworkCode = typeof uppercasedNetworkCodes[number];
export type tickersCategories = 'USD' | 'ORN' | 'BNB' | 'ALTS';
export type TickersCategories = 'USD' | 'ORN' | 'BNB' | 'ALTS';
export type tickersSortBy = 'PRICE' | 'CHANGE' | 'VOLUME';
export type TickersSortBy = 'PRICE' | 'CHANGE' | 'VOLUME';
export type tickersSortType = 'ASCENDING' | 'DESCENDING';
export type TickersSortType = 'ASCENDING' | 'DESCENDING';
export type tickersBaseSearchParams = {
export type TickersBaseSearchParams = {
currentNetwork?: NetworkCode
targetNetwork?: NetworkCode
sortBy?: tickersSortBy
sortType?: tickersSortType
sortBy?: TickersSortBy
sortType?: TickersSortType
offset?: number
limit?: number
}