@orca-so/whirlpools-sdk
Version:
Typescript SDK to interact with Orca's Whirlpool program.
40 lines (39 loc) • 4.03 kB
TypeScript
import type { Address } from "@coral-xyz/anchor";
import type { AccountFetcher, ParsableEntity, MintWithTokenProgram, AccountWithTokenProgram as TokenAccountWithTokenProgram } from "@orca-so/common-sdk";
import type { Connection } from "@solana/web3.js";
import type { WhirlpoolAccountFetchOptions, WhirlpoolAccountFetcherInterface, WhirlpoolSupportedTypes } from "..";
import type { FeeTierData, LockConfigData, PositionBundleData, PositionData, TickArrayData, TokenBadgeData, WhirlpoolData, WhirlpoolsConfigData, WhirlpoolsConfigExtensionData } from "../../../types/public";
export declare const buildDefaultAccountFetcher: (connection: Connection) => WhirlpoolAccountFetcher;
export declare class WhirlpoolAccountFetcher implements WhirlpoolAccountFetcherInterface {
readonly connection: Connection;
readonly fetcher: AccountFetcher<WhirlpoolSupportedTypes, WhirlpoolAccountFetchOptions>;
private _accountRentExempt;
private _epochInfo;
private _epochInfoNextFetchTime;
constructor(connection: Connection, fetcher: AccountFetcher<WhirlpoolSupportedTypes, WhirlpoolAccountFetchOptions>);
getAccountRentExempt(refresh?: boolean): Promise<number>;
getEpoch(refresh?: boolean): Promise<number>;
getPool(address: Address, opts?: WhirlpoolAccountFetchOptions): Promise<WhirlpoolData | null>;
getPools(addresses: Address[], opts?: WhirlpoolAccountFetchOptions): Promise<ReadonlyMap<string, WhirlpoolData | null>>;
getPosition(address: Address, opts?: WhirlpoolAccountFetchOptions): Promise<PositionData | null>;
getPositions(addresses: Address[], opts?: WhirlpoolAccountFetchOptions): Promise<ReadonlyMap<string, PositionData | null>>;
getTickArray(address: Address, opts?: WhirlpoolAccountFetchOptions): Promise<TickArrayData | null>;
getTickArrays(addresses: Address[], opts?: WhirlpoolAccountFetchOptions): Promise<ReadonlyArray<TickArrayData | null>>;
getFeeTier(address: Address, opts?: WhirlpoolAccountFetchOptions): Promise<FeeTierData | null>;
getFeeTiers(addresses: Address[], opts?: WhirlpoolAccountFetchOptions): Promise<ReadonlyMap<string, FeeTierData | null>>;
getTokenInfo(address: Address, opts?: WhirlpoolAccountFetchOptions): Promise<TokenAccountWithTokenProgram | null>;
getTokenInfos(addresses: Address[], opts?: WhirlpoolAccountFetchOptions): Promise<ReadonlyMap<string, TokenAccountWithTokenProgram | null>>;
getMintInfo(address: Address, opts?: WhirlpoolAccountFetchOptions): Promise<MintWithTokenProgram | null>;
getMintInfos(addresses: Address[], opts?: WhirlpoolAccountFetchOptions): Promise<ReadonlyMap<string, MintWithTokenProgram | null>>;
getConfig(address: Address, opts?: WhirlpoolAccountFetchOptions): Promise<WhirlpoolsConfigData | null>;
getConfigs(addresses: Address[], opts?: WhirlpoolAccountFetchOptions): Promise<ReadonlyMap<string, WhirlpoolsConfigData | null>>;
getPositionBundle(address: Address, opts?: WhirlpoolAccountFetchOptions): Promise<PositionBundleData | null>;
getPositionBundles(addresses: Address[], opts?: WhirlpoolAccountFetchOptions): Promise<ReadonlyMap<string, PositionBundleData | null>>;
getConfigExtension(address: Address, opts?: WhirlpoolAccountFetchOptions): Promise<WhirlpoolsConfigExtensionData | null>;
getConfigExtensions(addresses: Address[], opts?: WhirlpoolAccountFetchOptions): Promise<ReadonlyMap<string, WhirlpoolsConfigExtensionData | null>>;
getTokenBadge(address: Address, opts?: WhirlpoolAccountFetchOptions): Promise<TokenBadgeData | null>;
getTokenBadges(addresses: Address[], opts?: WhirlpoolAccountFetchOptions): Promise<ReadonlyMap<string, TokenBadgeData | null>>;
getLockConfig(address: Address, opts?: WhirlpoolAccountFetchOptions): Promise<LockConfigData | null>;
getLockConfigs(addresses: Address[], opts?: WhirlpoolAccountFetchOptions): Promise<ReadonlyMap<string, LockConfigData | null>>;
populateCache<T extends WhirlpoolSupportedTypes>(accounts: ReadonlyMap<string, T>, parser: ParsableEntity<T>, now?: number): void;
}