@orderly.network/net 1.0.10 → 1.0.11

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @orderly.network/net@1.0.8 build /Users/leo/orderly/orderly-web/packages/net
2
+ > @orderly.network/net@1.0.10 build /Users/leo/orderly/orderly-web/packages/net
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -10,13 +10,13 @@ CLI Target: es6
10
10
  CLI Cleaning output folder
11
11
  CJS Build start
12
12
  ESM Build start
13
- ESM dist/index.mjs 19.08 KB
14
- ESM dist/index.mjs.map 33.96 KB
15
- ESM ⚡️ Build success in 18ms
16
- CJS dist/index.js 20.17 KB
17
- CJS dist/index.js.map 34.29 KB
18
- CJS ⚡️ Build success in 18ms
13
+ CJS dist/index.js 20.69 KB
14
+ CJS dist/index.js.map 34.82 KB
15
+ CJS ⚡️ Build success in 16ms
16
+ ESM dist/index.mjs 19.57 KB
17
+ ESM dist/index.mjs.map 34.48 KB
18
+ ESM ⚡️ Build success in 16ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 676ms
21
- DTS dist/index.d.ts 2.93 KB
22
- DTS dist/index.d.mts 2.93 KB
20
+ DTS ⚡️ Build success in 1146ms
21
+ DTS dist/index.d.ts 3.10 KB
22
+ DTS dist/index.d.mts 3.10 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @orderly.network/net
2
2
 
3
+ ## 1.0.11
4
+
5
+ ### Patch Changes
6
+
7
+ - update
8
+
3
9
  ## 1.0.10
4
10
 
5
11
  ### Patch Changes
@@ -0,0 +1,87 @@
1
+ import { Observable } from 'rxjs';
2
+
3
+ declare function get<R>(url: string, options?: RequestInit, formatter?: (data: any) => R): Promise<R>;
4
+ declare function post(url: string, data: any, options?: Omit<RequestInit, "method">): Promise<any>;
5
+ declare function put(url: string, data: any, options?: Omit<RequestInit, "method">): Promise<any>;
6
+ declare function del(url: string, options?: Omit<RequestInit, "method">): Promise<any>;
7
+ declare function mutate(url: string, init: RequestInit): Promise<any>;
8
+
9
+ type NetworkId$1 = "testnet" | "mainnet";
10
+ type WSOptions$1 = {
11
+ url?: string;
12
+ networkId?: NetworkId$1;
13
+ accountId?: string;
14
+ onSigntureRequest?: (accountId: string) => Promise<any>;
15
+ };
16
+ declare class WebSocketClient {
17
+ private static __topicRefCountMap;
18
+ private wsSubject;
19
+ private privateWsSubject?;
20
+ private authenticated;
21
+ private _pendingPrivateSubscribe;
22
+ constructor(options: WSOptions$1);
23
+ private createSubject;
24
+ private createPrivateSubject;
25
+ private bindSubscribe;
26
+ private authenticate;
27
+ send: (message: any) => void;
28
+ privateSend: (message: any) => void;
29
+ get isAuthed(): boolean;
30
+ observe<T>(params: any, unsubscribe?: () => any, messageFilter?: (value: T) => boolean): Observable<T>;
31
+ privateObserve<T>(params: any, unsubscribe?: () => any, messageFilter?: (value: T) => boolean): Observable<T>;
32
+ private _observe;
33
+ private generateMessage;
34
+ private _sendPendingPrivateMessage;
35
+ desotry(): void;
36
+ }
37
+
38
+ declare const __ORDERLY_API_URL_KEY__: string;
39
+
40
+ type NetworkId = "testnet" | "mainnet";
41
+ type WSOptions = {
42
+ url?: string;
43
+ networkId?: NetworkId;
44
+ accountId?: string;
45
+ onSigntureRequest?: (accountId: string) => Promise<any>;
46
+ };
47
+ type unsubscribe = () => void;
48
+ type WSMessageHandler = {
49
+ onMessage: (message: any) => void;
50
+ onError?: (error: any) => void;
51
+ onClose?: (event: any) => void;
52
+ onUnsubscribe: (event: any) => any;
53
+ formatter?: (message: any) => any;
54
+ };
55
+ declare class WS {
56
+ private readonly options;
57
+ private publicSocket;
58
+ private privateSocket?;
59
+ private publicIsReconnecting;
60
+ private privateIsReconnecting;
61
+ private reconnectInterval;
62
+ private authenticated;
63
+ private _pendingPrivateSubscribe;
64
+ private _pendingPublicSubscribe;
65
+ private _eventHandlers;
66
+ constructor(options: WSOptions);
67
+ private createPublicSC;
68
+ private createPrivateSC;
69
+ private onOpen;
70
+ private onPrivateOpen;
71
+ private onMessage;
72
+ private onClose;
73
+ private onError;
74
+ private onPrivateError;
75
+ send: (message: any) => void;
76
+ close(): void;
77
+ set accountId(accountId: string);
78
+ private authenticate;
79
+ privateSubscribe(params: any, callback: WSMessageHandler): void;
80
+ subscribe(params: any, callback: WSMessageHandler | Omit<WSMessageHandler, "onUnsubscribe">, once?: boolean): unsubscribe | undefined;
81
+ onceSubscribe(params: any, callback: Omit<WSMessageHandler, "onUnsubscribe">): void;
82
+ private unsubscribe;
83
+ private generateMessage;
84
+ private reconnectPublic;
85
+ }
86
+
87
+ export { NetworkId$1 as NetworkId, WS, WSOptions$1 as WSOptions, WebSocketClient, __ORDERLY_API_URL_KEY__, del, get, mutate, post, put };
@@ -0,0 +1,87 @@
1
+ import { Observable } from 'rxjs';
2
+
3
+ declare function get<R>(url: string, options?: RequestInit, formatter?: (data: any) => R): Promise<R>;
4
+ declare function post(url: string, data: any, options?: Omit<RequestInit, "method">): Promise<any>;
5
+ declare function put(url: string, data: any, options?: Omit<RequestInit, "method">): Promise<any>;
6
+ declare function del(url: string, options?: Omit<RequestInit, "method">): Promise<any>;
7
+ declare function mutate(url: string, init: RequestInit): Promise<any>;
8
+
9
+ type NetworkId$1 = "testnet" | "mainnet";
10
+ type WSOptions$1 = {
11
+ url?: string;
12
+ networkId?: NetworkId$1;
13
+ accountId?: string;
14
+ onSigntureRequest?: (accountId: string) => Promise<any>;
15
+ };
16
+ declare class WebSocketClient {
17
+ private static __topicRefCountMap;
18
+ private wsSubject;
19
+ private privateWsSubject?;
20
+ private authenticated;
21
+ private _pendingPrivateSubscribe;
22
+ constructor(options: WSOptions$1);
23
+ private createSubject;
24
+ private createPrivateSubject;
25
+ private bindSubscribe;
26
+ private authenticate;
27
+ send: (message: any) => void;
28
+ privateSend: (message: any) => void;
29
+ get isAuthed(): boolean;
30
+ observe<T>(params: any, unsubscribe?: () => any, messageFilter?: (value: T) => boolean): Observable<T>;
31
+ privateObserve<T>(params: any, unsubscribe?: () => any, messageFilter?: (value: T) => boolean): Observable<T>;
32
+ private _observe;
33
+ private generateMessage;
34
+ private _sendPendingPrivateMessage;
35
+ desotry(): void;
36
+ }
37
+
38
+ declare const __ORDERLY_API_URL_KEY__: string;
39
+
40
+ type NetworkId = "testnet" | "mainnet";
41
+ type WSOptions = {
42
+ url?: string;
43
+ networkId?: NetworkId;
44
+ accountId?: string;
45
+ onSigntureRequest?: (accountId: string) => Promise<any>;
46
+ };
47
+ type unsubscribe = () => void;
48
+ type WSMessageHandler = {
49
+ onMessage: (message: any) => void;
50
+ onError?: (error: any) => void;
51
+ onClose?: (event: any) => void;
52
+ onUnsubscribe: (event: any) => any;
53
+ formatter?: (message: any) => any;
54
+ };
55
+ declare class WS {
56
+ private readonly options;
57
+ private publicSocket;
58
+ private privateSocket?;
59
+ private publicIsReconnecting;
60
+ private privateIsReconnecting;
61
+ private reconnectInterval;
62
+ private authenticated;
63
+ private _pendingPrivateSubscribe;
64
+ private _pendingPublicSubscribe;
65
+ private _eventHandlers;
66
+ constructor(options: WSOptions);
67
+ private createPublicSC;
68
+ private createPrivateSC;
69
+ private onOpen;
70
+ private onPrivateOpen;
71
+ private onMessage;
72
+ private onClose;
73
+ private onError;
74
+ private onPrivateError;
75
+ send: (message: any) => void;
76
+ close(): void;
77
+ set accountId(accountId: string);
78
+ private authenticate;
79
+ privateSubscribe(params: any, callback: WSMessageHandler): void;
80
+ subscribe(params: any, callback: WSMessageHandler | Omit<WSMessageHandler, "onUnsubscribe">, once?: boolean): unsubscribe | undefined;
81
+ onceSubscribe(params: any, callback: Omit<WSMessageHandler, "onUnsubscribe">): void;
82
+ private unsubscribe;
83
+ private generateMessage;
84
+ private reconnectPublic;
85
+ }
86
+
87
+ export { NetworkId$1 as NetworkId, WS, WSOptions$1 as WSOptions, WebSocketClient, __ORDERLY_API_URL_KEY__, del, get, mutate, post, put };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orderly.network/net",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -17,7 +17,7 @@
17
17
  "rxjs": "^7.8.1",
18
18
  "tsup": "^7.1.0",
19
19
  "typescript": "^5.1.6",
20
- "tsconfig": "0.0.10"
20
+ "tsconfig": "0.0.11"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "rxjs": "^7.8.1"