UNPKG

bybit-api-gnome

Version:

Forked for Lick Hunter, Complete & robust node.js SDK for Bybit's REST APIs and WebSockets v5, with TypeScript & integration tests.

54 lines (53 loc) 2.43 kB
export interface RestClientOptions { /** Your API key */ key?: string; /** Your API secret */ secret?: string; /** Set to `true` to connect to testnet. Uses the live environment by default. */ testnet?: boolean; /** Override the max size of the request window (in ms) */ recv_window?: number; /** Disabled by default. This can help on machines with consistent latency problems. */ enable_time_sync?: boolean; /** How often to sync time drift with bybit servers */ sync_interval_ms?: number | string; /** Default: false. If true, we'll throw errors if any params are undefined */ strict_param_validation?: boolean; /** * Default: true. * If true, request parameters will be URI encoded during the signing process. * New behaviour introduced in v3.2.1 to fix rare parameter-driven sign errors with unified margin cursors containing "%". */ encodeSerialisedValues?: boolean; /** * Optionally override API protocol + domain * e.g baseUrl: 'https://api.bytick.com' **/ baseUrl?: string; /** Default: true. whether to try and post-process request exceptions. */ parse_exceptions?: boolean; } /** * Serialise a (flat) object into a query string * @param params the object to serialise * @param strict_validation throw if any properties are undefined * @param sortProperties sort properties alphabetically before building a query string * @param encodeSerialisedValues URL encode value before serialising * @returns the params object as a serialised string key1=value1&key2=value2&etc */ export declare function serializeParams(params?: object, strict_validation?: boolean, sortProperties?: boolean, encodeSerialisedValues?: boolean): string; export declare function getRestBaseUrl(useTestnet: boolean, restInverseOptions: RestClientOptions): string; export declare function isWsPong(msg: any): boolean; export declare const APIID = "GoatAlerts"; /** * Used to switch how authentication/requests work under the hood (primarily for SPOT since it's different there) */ export declare const REST_CLIENT_TYPE_ENUM: { readonly accountAsset: "accountAsset"; readonly inverse: "inverse"; readonly inverseFutures: "inverseFutures"; readonly linear: "linear"; readonly spot: "spot"; readonly v3: "v3"; }; export type RestClientType = typeof REST_CLIENT_TYPE_ENUM[keyof typeof REST_CLIENT_TYPE_ENUM];