test-raydium-sdk-v2
Version:
An SDK for building applications on top of Raydium.
79 lines (76 loc) • 2.69 kB
TypeScript
import { AxiosInstance } from 'axios';
import { Cluster } from '../solana/type.js';
import { b as ApiClmmConfigInfo, e as ApiV3Token, J as JupTokenType, o as FetchPoolParams, P as PoolsApiReturn, S as SearchPoolsApiReturn, t as PoolKeys, E as FormatFarmKeyOut, Q as AvailabilityCheckAPI3 } from '../type-91d108de.js';
import { API_URL_CONFIG } from './url.js';
import { PublicKey } from '@solana/web3.js';
import 'bn.js';
import '@solana/spl-token';
import '../common/txTool/txType.js';
import '../common/owner.js';
import '../common/txTool/lookupTable.js';
import 'decimal.js';
import '../module/token.js';
import '../common/pubKey.js';
import '../marshmallow/index.js';
import '../marshmallow/buffer-layout.js';
import '../common/logger.js';
import '../module/currency.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);
getClmmConfigs(): Promise<ApiClmmConfigInfo[]>;
getClmmPoolLines(poolId: string): Promise<{
price: string;
liquidity: string;
}[]>;
getRaydiumTokenPrice(): Promise<Record<string, number>>;
getBlockSlotCountForSecond(endpointUrl?: string): Promise<number>;
getChainTimeOffset(): Promise<{
offset: number;
}>;
getRpcs(): Promise<{
rpcs: {
batch: boolean;
name: string;
url: string;
weight: number;
}[];
strategy: string;
}>;
getTokenList(): Promise<{
mintList: ApiV3Token[];
blacklist: ApiV3Token[];
}>;
getJupTokenList(type?: JupTokenType): Promise<ApiV3Token[]>;
getTokenInfo(mint: string | PublicKey): Promise<ApiV3Token | undefined>;
getPoolList(props?: FetchPoolParams): Promise<PoolsApiReturn>;
searchPoolById(props: {
ids: string;
}): Promise<SearchPoolsApiReturn>;
searchPoolByMint(props: FetchPoolParams & {
mint: string;
}): Promise<PoolsApiReturn>;
searchPoolByMints(props: FetchPoolParams & {
mint1: string;
mint2: string;
}): Promise<PoolsApiReturn>;
fetchPoolKeysById(props: {
id: string;
}): Promise<PoolKeys>;
fetchFarmKeysById(props: {
ids: string;
}): Promise<FormatFarmKeyOut[]>;
fetchAvailabilityStatus(): Promise<AvailabilityCheckAPI3>;
}
export { Api, ApiProps, endlessRetry };