@medievalrain/binance-ts 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.ts +46 -45
  2. package/package.json +6 -6
package/dist/index.d.ts CHANGED
@@ -3,6 +3,49 @@ import { Client, WebSocket } from "undici";
3
3
  import * as z4 from "zod/v4/core";
4
4
  import { CallbackOptions } from "@medievalrain/emitter";
5
5
 
6
+ //#region src/shared/base-rest-client.d.ts
7
+ type RawSearchParams = Record<string, string | undefined | null | string[] | number | boolean>;
8
+ declare class BaseRestClient {
9
+ private httpCleint;
10
+ private apiKey?;
11
+ private apiSecret?;
12
+ constructor({
13
+ baseUrl,
14
+ apiKey,
15
+ apiSecret,
16
+ httpOptions
17
+ }: {
18
+ baseUrl: string;
19
+ apiKey?: string;
20
+ apiSecret?: string;
21
+ httpOptions?: Client.Options;
22
+ });
23
+ private toSearchParams;
24
+ private parseErrorResponse;
25
+ private parseResponse;
26
+ protected publicRequest<T extends z4.$ZodType>({
27
+ endpoint,
28
+ params,
29
+ schema
30
+ }: {
31
+ endpoint: string;
32
+ params?: RawSearchParams;
33
+ schema: T;
34
+ }): Promise<z4.output<T>>;
35
+ protected privateRequest<T extends z4.$ZodType>({
36
+ endpoint,
37
+ params,
38
+ schema,
39
+ method
40
+ }: {
41
+ endpoint: string;
42
+ params?: RawSearchParams;
43
+ method: "GET" | "POST" | "DELETE";
44
+ schema: T;
45
+ }): Promise<z4.output<T>>;
46
+ private sign;
47
+ }
48
+ //#endregion
6
49
  //#region src/rest/futures/schema.d.ts
7
50
  declare const FuturesTestConnectivitySchema: z.ZodObject<{}, z.core.$strip>;
8
51
  declare const FuturesCheckServerTimeSchema: z.ZodObject<{
@@ -785,49 +828,6 @@ declare const FuturesNewOrderSchema: z.ZodObject<{
785
828
  goodTillDate: z.ZodOptional<z.ZodNumber>;
786
829
  }, z.core.$strip>;
787
830
  //#endregion
788
- //#region src/shared/base-rest-client.d.ts
789
- type RawSearchParams = Record<string, string | undefined | null | string[] | number | boolean>;
790
- declare class BaseRestClient {
791
- private httpCleint;
792
- private apiKey?;
793
- private apiSecret?;
794
- constructor({
795
- baseUrl,
796
- apiKey,
797
- apiSecret,
798
- httpOptions
799
- }: {
800
- baseUrl: string;
801
- apiKey?: string;
802
- apiSecret?: string;
803
- httpOptions?: Client.Options;
804
- });
805
- private toSearchParams;
806
- private parseErrorResponse;
807
- private parseResponse;
808
- protected publicRequest<T extends z4.$ZodType>({
809
- endpoint,
810
- params,
811
- schema
812
- }: {
813
- endpoint: string;
814
- params?: RawSearchParams;
815
- schema: T;
816
- }): Promise<z4.output<T>>;
817
- protected privateRequest<T extends z4.$ZodType>({
818
- endpoint,
819
- params,
820
- schema,
821
- method
822
- }: {
823
- endpoint: string;
824
- params?: RawSearchParams;
825
- method: "GET" | "POST" | "DELETE";
826
- schema: T;
827
- }): Promise<z4.output<T>>;
828
- private sign;
829
- }
830
- //#endregion
831
831
  //#region src/rest/futures/types.d.ts
832
832
  type FuturesKlineInterval = "1s" | "1m" | "3m" | "5m" | "30m" | "1h" | "2h" | "6h" | "8h" | "12h" | "3d" | "1M";
833
833
  type FuturesContractType = z$1.infer<typeof FuturesContractTypeSchema>;
@@ -1318,7 +1318,7 @@ declare class FuturesRestClient extends BaseRestClient {
1318
1318
  }>;
1319
1319
  incomeHistory(params?: {
1320
1320
  symbol?: string;
1321
- incomeType?: z$1.infer<typeof FuturesIncomeTypeSchema>;
1321
+ incomeType?: FuturesIncomeType;
1322
1322
  startTime?: number;
1323
1323
  endTime?: number;
1324
1324
  page?: number;
@@ -1492,7 +1492,8 @@ type OptArgs<CM extends ChannelsMap, K extends keyof CM> = CM[K]["subscriptionOp
1492
1492
  type WebsocketClient<CM extends ChannelsMap> = { [K in keyof CM]: {
1493
1493
  subscribe: (symbols: string[], ...args: OptArgs<CM, K>) => Promise<void>;
1494
1494
  unsubscribe: (symbols: string[], ...args: OptArgs<CM, K>) => Promise<void>;
1495
- addEventListener: (cb: (data: CM[K]["messageSchema"]) => void, options?: CallbackOptions) => void;
1495
+ on: (cb: (data: CM[K]["messageSchema"]) => void, options?: CallbackOptions) => void;
1496
+ off: (cb: (data: CM[K]["messageSchema"]) => void) => void;
1496
1497
  } };
1497
1498
  //#endregion
1498
1499
  //#region src/websocket/futures/types.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medievalrain/binance-ts",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Binance API SDK",
5
5
  "access": "public",
6
6
  "type": "module",
@@ -21,12 +21,12 @@
21
21
  "test": "vitest"
22
22
  },
23
23
  "devDependencies": {
24
- "@types/node": "24.5.0",
24
+ "@types/node": "24.5.2",
25
25
  "date-fns": "4.1.0",
26
26
  "dotenv": "17.2.2",
27
- "oxlint": "1.15.0",
27
+ "oxlint": "1.17.0",
28
28
  "prettier": "3.6.2",
29
- "tsdown": "0.15.1",
29
+ "tsdown": "0.15.4",
30
30
  "typescript": "5.9.2",
31
31
  "vitest": "4.0.0-beta.11"
32
32
  },
@@ -34,7 +34,7 @@
34
34
  "zod": "^4"
35
35
  },
36
36
  "dependencies": {
37
- "@medievalrain/emitter": "0.1.0",
37
+ "@medievalrain/emitter": "0.2.16",
38
38
  "undici": "7.16.0"
39
39
  },
40
40
  "repository": {
@@ -44,5 +44,5 @@
44
44
  "engines": {
45
45
  "node": ">=22.19.0"
46
46
  },
47
- "packageManager": "pnpm@10.16.1"
47
+ "packageManager": "pnpm@10.17.1"
48
48
  }