@ninerealms/midgard-client
Version:
228 lines • 8.16 kB
TypeScript
import { IntervalResponse, IntervalKey, Interval, IntervalRequest } from './utils';
import BigNumber from 'bignumber.js';
export interface HistoryPoolSwapIntervalResponse extends IntervalResponse {
toAssetCount: string;
toRuneCount: string;
totalCount: string;
toAssetVolume: string;
toRuneVolume: string;
totalVolume: string;
toAssetFees: string;
toRuneFees: string;
totalFees: string;
toAssetAverageSlip: string;
toRuneAverageSlip: string;
averageSlip: string;
runePriceUSD: string;
}
export interface HistoryPoolSwapInterval extends Interval {
toAssetCount: BigNumber;
toRuneCount: BigNumber;
totalCount: BigNumber;
toAssetVolume: BigNumber;
toRuneVolume: BigNumber;
totalVolume: BigNumber;
toAssetFees: BigNumber;
toRuneFees: BigNumber;
totalFees: BigNumber;
toAssetAverageSlip: BigNumber;
toRuneAverageSlip: BigNumber;
averageSlip: BigNumber;
runePriceUSD: BigNumber;
}
export interface HistoryDepthIntervalResponse extends IntervalResponse {
assetDepth: string;
runeDepth: string;
assetPrice: string;
assetPriceUSD: string;
liquidityUnits: string;
synthUnits: string;
synthSupply: string;
units: string;
}
export interface HistoryDepthInterval extends Interval {
assetDepth: BigNumber;
runeDepth: BigNumber;
assetPrice: BigNumber;
assetPriceUSD: BigNumber;
liquidityUnits: BigNumber;
synthUnits: BigNumber;
synthSupply: BigNumber;
units: BigNumber;
}
export interface HistoryDepthResponse {
meta: IntervalResponse;
intervals: HistoryDepthIntervalResponse[];
}
export interface IntervalRequestWithPool extends IntervalRequest {
pool: string;
}
export interface IntervalResponseWithPool extends IntervalResponse {
pool: string;
}
export interface HistoryDepth {
meta: IntervalResponseWithPool;
intervals: HistoryDepthInterval[];
}
export interface HistoryRequestOptions {
interval?: IntervalKey;
count?: number;
to?: number;
from?: number;
}
export interface HistoryPoolRequestOptions extends HistoryRequestOptions {
pool: string;
}
export interface IntervalResponseWithEarnings extends IntervalResponse {
liquidityFees: string;
blockRewards: string;
earnings: string;
bondingEarnings: string;
liquidityEarnings: string;
avgNodeCount: string;
runePriceUSD: string;
}
export interface HistoryEarningsIntervalPoolResponse extends IntervalResponse {
pool: string;
assetLiquidityFees: string;
runeLiquidityFees: string;
totalLiquidityFeesRune: string;
rewards: string;
earnings: string;
}
export interface HistoryEarningsIntervalPool extends Interval {
pool: string;
assetLiquidityFees: BigNumber;
runeLiquidityFees: BigNumber;
totalLiquidityFeesRune: BigNumber;
rewards: BigNumber;
earnings: BigNumber;
}
export interface HistoryEarningsIntervalPoolFlat extends HistoryEarningsIntervalPool {
runePriceUSD: BigNumber;
}
export interface HistoryEarningsIntervalResponse extends IntervalResponseWithEarnings {
pools: HistoryEarningsIntervalPoolResponse[];
}
export interface HistoryEarningsResponse {
meta: IntervalResponseWithEarnings;
intervals: HistoryEarningsIntervalResponse[];
}
export interface IntervalWithEarnings extends Interval {
liquidityFees: BigNumber;
blockRewards: BigNumber;
earnings: BigNumber;
bondingEarnings: BigNumber;
liquidityEarnings: BigNumber;
avgNodeCount: BigNumber;
runePriceUSD: BigNumber;
}
export interface HistoryEarningsInterval extends IntervalWithEarnings {
pools: HistoryEarningsIntervalPool[];
}
export interface HistoryEarnings {
meta: IntervalWithEarnings;
intervals: HistoryEarningsInterval[];
}
export declare const flattenHistoryEarningsIntervals: (earnings: HistoryEarnings) => HistoryEarningsIntervalPoolFlat[];
export declare const convertIntervalPool: (intervalPool: HistoryEarningsIntervalPoolResponse) => HistoryEarningsIntervalPool;
export interface HistoryPoolSwapResponse {
meta: HistoryPoolSwapIntervalResponse;
intervals: HistoryPoolSwapIntervalResponse[];
}
export interface HistoryPoolSwap {
meta: HistoryPoolSwapInterval;
intervals: HistoryPoolSwapInterval[];
}
export declare const rawToHistoryIntervalSwap: (res: HistoryPoolSwapIntervalResponse) => HistoryPoolSwapInterval;
export declare const rawToHistorySwap: (res: HistoryPoolSwapResponse) => HistoryPoolSwap;
export declare const historySwap: ({ pool, ...options }: HistoryPoolRequestOptions) => Promise<HistoryPoolSwap>;
export declare const historyEarnings: (options?: HistoryRequestOptions | undefined) => Promise<{
meta: {
liquidityFees: BigNumber;
blockRewards: BigNumber;
earnings: BigNumber;
bondingEarnings: BigNumber;
liquidityEarnings: BigNumber;
avgNodeCount: BigNumber;
runePriceUSD: BigNumber;
startTime: Date;
endTime: Date;
};
intervals: {
pools: HistoryEarningsIntervalPool[];
liquidityFees: BigNumber;
blockRewards: BigNumber;
earnings: BigNumber;
bondingEarnings: BigNumber;
liquidityEarnings: BigNumber;
avgNodeCount: BigNumber;
runePriceUSD: BigNumber;
startTime: Date;
endTime: Date;
}[];
}>;
export declare const convertHistoryDepthInterval: (interval: HistoryDepthIntervalResponse) => HistoryDepthInterval;
export declare const historyDepths: ({ pool, ...options }: HistoryPoolRequestOptions) => Promise<HistoryDepth>;
export declare const historyDepthsPoolsMany: (pools: HistoryPoolRequestOptions[]) => Promise<HistoryDepth[]>;
export interface HistoryTVLIntervalResponse extends IntervalResponse {
totalValuePooled: string;
totalValueBonded: string;
totalValueLocked: string;
runePriceUSD: string;
}
export interface HistoryTVLInterval extends Interval {
totalValuePooled: BigNumber;
totalValueBonded: BigNumber;
totalValueLocked: BigNumber;
runePriceUSD: BigNumber;
}
export interface HistoryTVLResponse {
meta: HistoryTVLIntervalResponse;
intervals: HistoryTVLIntervalResponse[];
}
export interface HistoryTVL {
meta: HistoryTVLInterval;
intervals: HistoryTVLInterval[];
}
export declare const rawToHistoryIntervalTVL: (tvlInterval: HistoryTVLIntervalResponse) => HistoryTVLInterval;
export declare const rawToHistoryTVL: (tvl: HistoryTVLResponse) => HistoryTVL;
export declare const historyTVL: (interval: IntervalRequest) => Promise<HistoryTVL>;
export interface HistoryLiquidityChangesIntervalResponse extends IntervalResponse {
addAssetLiquidityVolume: string;
addRuneLiquidityVolume: string;
addLiquidityVolume: string;
addLiquidityCount: string;
withdrawAssetVolume: string;
withdrawRuneVolume: string;
impermanentLossProtectionPaid: string;
withdrawVolume: string;
withdrawCount: string;
net: string;
runePriceUSD: string;
}
export interface HistoryLiquidityChangesInterval extends Interval {
addAssetLiquidityVolume: BigNumber;
addRuneLiquidityVolume: BigNumber;
addLiquidityVolume: BigNumber;
addLiquidityCount: BigNumber;
withdrawAssetVolume: BigNumber;
withdrawRuneVolume: BigNumber;
impermanentLossProtectionPaid: BigNumber;
withdrawVolume: BigNumber;
withdrawCount: BigNumber;
net: BigNumber;
runePriceUSD: BigNumber;
}
export interface HistoryLiquidityChangesResponse {
meta: HistoryLiquidityChangesIntervalResponse;
intervals: HistoryLiquidityChangesIntervalResponse[];
}
export interface HistoryLiquidityChanges {
meta: HistoryLiquidityChangesInterval;
intervals: HistoryLiquidityChangesInterval[];
}
export declare const rawToHistoryLiquidityChangesInterval: (changes: HistoryLiquidityChangesIntervalResponse) => HistoryLiquidityChangesInterval;
export declare const rawToHistoryLiquidityChanges: (changes: HistoryLiquidityChangesResponse) => HistoryLiquidityChanges;
export declare const historyLiquidityChanges: (options: IntervalRequestWithPool) => Promise<HistoryLiquidityChanges>;
//# sourceMappingURL=history.d.ts.map