UNPKG

@sega-so/sega-sdk

Version:

An SDK for building applications on top of SEGA.

53 lines (50 loc) 1.67 kB
import { AxiosInstance } from 'axios'; import { Cluster } from '../solana/type.js'; import { ApiCpmmConfigInfo, PoolKeys, ApiV3Token, AvailabilityCheckAPI3 } from './type.js'; import { API_URL_CONFIG } from './url.js'; import { PublicKey } from '@solana/web3.js'; declare function endlessRetry<T>(name: string, call: () => Promise<T>, interval?: number): Promise<T>; interface ApiProps { cluster: Cluster; timeout: number; logRequests?: boolean; logCount?: number; urlConfigs?: API_URL_CONFIG; } declare class Api { cluster: Cluster; api: AxiosInstance; logCount: number; urlConfigs: API_URL_CONFIG; constructor({ cluster, timeout, logRequests, logCount, urlConfigs }: ApiProps); getCpmmConfigs(): Promise<ApiCpmmConfigInfo[]>; getBlockSlotCountForSecond(endpointUrl?: string): Promise<number>; getChainTimeOffset(): Promise<{ offset: number; }>; fetchPoolKeysById(props: { idList: string[]; }): Promise<PoolKeys[]>; getRpcs(): Promise<{ rpcs: { batch: boolean; name: string; url: string; weight: number; }[]; strategy: string; }>; getTokenList(): Promise<{ mintList: ApiV3Token[]; blacklist: string[]; whiteList: string[]; }>; getJupTokenList(): Promise<(ApiV3Token & { daily_volume: number; freeze_authority: string | null; mint_authority: string | null; })[]>; getTokenInfo(mint: (string | PublicKey)[]): Promise<ApiV3Token[]>; fetchAvailabilityStatus(): Promise<AvailabilityCheckAPI3>; } export { Api, type ApiProps, endlessRetry };