mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-17 00:31:34 +03:00
feat: types updates
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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 ? `¤tNetwork=${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 ? `¤tNetwork=${encodeURIComponent(currentNetwork)}` : '',
|
||||
|
||||
12
src/types.ts
12
src/types.ts
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user