@strong-roots-capital/bybit-api
Version:
TypeScript API for Bybit cryptocurrency exchange
52 lines • 2.03 kB
TypeScript
import * as t from 'io-ts';
import * as P from 'parser-ts/Parser';
/*********************************************************************
* Parser combinators
********************************************************************/
export declare type BybitTimeframeAst = {
quantifier: number;
unit: string;
};
/**
* @internal
*/
export declare const Parser: P.Parser<string, BybitTimeframeAst>;
/**
* Timeframe Quantifiers
*
* Only support a subset of the timeframes that Bybit itself supports,
* to foster a rapid development time.
*/
declare const BybitTimeframeMinutesQuantifier: t.IntersectionC<[t.BrandC<t.NumberC, t.IntBrand>, t.UnionC<[t.LiteralC<1>, t.LiteralC<60>]>]>;
declare type BybitTimeframeMinutesQuantifier = t.TypeOf<typeof BybitTimeframeMinutesQuantifier>;
export declare const BybitTimeframe: t.UnionC<[t.TypeC<{
quantifier: t.IntersectionC<[t.BrandC<t.NumberC, t.IntBrand>, t.UnionC<[t.LiteralC<1>, t.LiteralC<60>]>]>;
unit: t.LiteralC<"minute">;
}>, t.TypeC<{
quantifier: t.IntersectionC<[t.BrandC<t.NumberC, t.IntBrand>, t.LiteralC<1>]>;
unit: t.LiteralC<"hour">;
}>, t.TypeC<{
quantifier: t.IntersectionC<[t.BrandC<t.NumberC, t.IntBrand>, t.LiteralC<1>]>;
unit: t.LiteralC<"day">;
}>, t.TypeC<{
quantifier: t.IntersectionC<[t.BrandC<t.NumberC, t.IntBrand>, t.LiteralC<1>]>;
unit: t.LiteralC<"week">;
}>]>;
export declare type BybitTimeframe = t.TypeOf<typeof BybitTimeframe>;
export declare const inMinutes: (a: BybitTimeframe) => BybitTimeframeMinutesQuantifier;
export declare const BybitTimeframeFromString: t.Type<{
quantifier: number & t.Brand<t.IntBrand> & (1 | 60);
unit: "minute";
} | {
quantifier: t.Brand<t.IntBrand> & 1;
unit: "hour";
} | {
quantifier: t.Brand<t.IntBrand> & 1;
unit: "day";
} | {
quantifier: t.Brand<t.IntBrand> & 1;
unit: "week";
}, string, unknown>;
export declare type BybitTimeframeFromString = t.TypeOf<typeof BybitTimeframeFromString>;
export {};
//# sourceMappingURL=BybitTimeframe.d.ts.map