@metamask-previews/core-backend 0.0.0-preview-bc80f5a1
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.
- package/CHANGELOG.md +26 -0
- package/LICENSE +20 -0
- package/README.md +360 -0
- package/dist/AccountActivityService-method-action-types.cjs +7 -0
- package/dist/AccountActivityService-method-action-types.cjs.map +1 -0
- package/dist/AccountActivityService-method-action-types.d.cts +30 -0
- package/dist/AccountActivityService-method-action-types.d.cts.map +1 -0
- package/dist/AccountActivityService-method-action-types.d.mts +30 -0
- package/dist/AccountActivityService-method-action-types.d.mts.map +1 -0
- package/dist/AccountActivityService-method-action-types.mjs +6 -0
- package/dist/AccountActivityService-method-action-types.mjs.map +1 -0
- package/dist/AccountActivityService.cjs +380 -0
- package/dist/AccountActivityService.cjs.map +1 -0
- package/dist/AccountActivityService.d.cts +148 -0
- package/dist/AccountActivityService.d.cts.map +1 -0
- package/dist/AccountActivityService.d.mts +148 -0
- package/dist/AccountActivityService.d.mts.map +1 -0
- package/dist/AccountActivityService.mjs +376 -0
- package/dist/AccountActivityService.mjs.map +1 -0
- package/dist/BackendWebSocketService-method-action-types.cjs +7 -0
- package/dist/BackendWebSocketService-method-action-types.cjs.map +1 -0
- package/dist/BackendWebSocketService-method-action-types.d.cts +146 -0
- package/dist/BackendWebSocketService-method-action-types.d.cts.map +1 -0
- package/dist/BackendWebSocketService-method-action-types.d.mts +146 -0
- package/dist/BackendWebSocketService-method-action-types.d.mts.map +1 -0
- package/dist/BackendWebSocketService-method-action-types.mjs +6 -0
- package/dist/BackendWebSocketService-method-action-types.mjs.map +1 -0
- package/dist/BackendWebSocketService.cjs +841 -0
- package/dist/BackendWebSocketService.cjs.map +1 -0
- package/dist/BackendWebSocketService.d.cts +366 -0
- package/dist/BackendWebSocketService.d.cts.map +1 -0
- package/dist/BackendWebSocketService.d.mts +366 -0
- package/dist/BackendWebSocketService.d.mts.map +1 -0
- package/dist/BackendWebSocketService.mjs +836 -0
- package/dist/BackendWebSocketService.mjs.map +1 -0
- package/dist/index.cjs +14 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +10 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +10 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +7 -0
- package/dist/index.mjs.map +1 -0
- package/dist/logger.cjs +7 -0
- package/dist/logger.cjs.map +1 -0
- package/dist/logger.d.cts +5 -0
- package/dist/logger.d.cts.map +1 -0
- package/dist/logger.d.mts +5 -0
- package/dist/logger.d.mts.map +1 -0
- package/dist/logger.mjs +4 -0
- package/dist/logger.mjs.map +1 -0
- package/dist/types.cjs +3 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +71 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.mts +71 -0
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +2 -0
- package/dist/types.mjs.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto generated by `scripts/generate-method-action-types.ts`.
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
*/
|
|
5
|
+
import type { BackendWebSocketService } from "./BackendWebSocketService.cjs";
|
|
6
|
+
/**
|
|
7
|
+
* Establishes WebSocket connection
|
|
8
|
+
*
|
|
9
|
+
* @returns Promise that resolves when connection is established
|
|
10
|
+
*/
|
|
11
|
+
export type BackendWebSocketServiceConnectAction = {
|
|
12
|
+
type: `BackendWebSocketService:connect`;
|
|
13
|
+
handler: BackendWebSocketService['connect'];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Closes WebSocket connection
|
|
17
|
+
*
|
|
18
|
+
* @returns Promise that resolves when disconnection is complete
|
|
19
|
+
*/
|
|
20
|
+
export type BackendWebSocketServiceDisconnectAction = {
|
|
21
|
+
type: `BackendWebSocketService:disconnect`;
|
|
22
|
+
handler: BackendWebSocketService['disconnect'];
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Sends a message through the WebSocket
|
|
26
|
+
*
|
|
27
|
+
* @param message - The message to send
|
|
28
|
+
* @returns Promise that resolves when message is sent
|
|
29
|
+
*/
|
|
30
|
+
export type BackendWebSocketServiceSendMessageAction = {
|
|
31
|
+
type: `BackendWebSocketService:sendMessage`;
|
|
32
|
+
handler: BackendWebSocketService['sendMessage'];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Sends a request and waits for a correlated response
|
|
36
|
+
*
|
|
37
|
+
* @param message - The request message
|
|
38
|
+
* @returns Promise that resolves with the response data
|
|
39
|
+
*/
|
|
40
|
+
export type BackendWebSocketServiceSendRequestAction = {
|
|
41
|
+
type: `BackendWebSocketService:sendRequest`;
|
|
42
|
+
handler: BackendWebSocketService['sendRequest'];
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Gets current connection information
|
|
46
|
+
*
|
|
47
|
+
* @returns Current connection status and details
|
|
48
|
+
*/
|
|
49
|
+
export type BackendWebSocketServiceGetConnectionInfoAction = {
|
|
50
|
+
type: `BackendWebSocketService:getConnectionInfo`;
|
|
51
|
+
handler: BackendWebSocketService['getConnectionInfo'];
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Gets all subscription information for a specific channel
|
|
55
|
+
*
|
|
56
|
+
* @param channel - The channel name to look up
|
|
57
|
+
* @returns Array of subscription details for all subscriptions containing the channel
|
|
58
|
+
*/
|
|
59
|
+
export type BackendWebSocketServiceGetSubscriptionsByChannelAction = {
|
|
60
|
+
type: `BackendWebSocketService:getSubscriptionsByChannel`;
|
|
61
|
+
handler: BackendWebSocketService['getSubscriptionsByChannel'];
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Checks if a channel has a subscription
|
|
65
|
+
*
|
|
66
|
+
* @param channel - The channel name to check
|
|
67
|
+
* @returns True if the channel has a subscription, false otherwise
|
|
68
|
+
*/
|
|
69
|
+
export type BackendWebSocketServiceChannelHasSubscriptionAction = {
|
|
70
|
+
type: `BackendWebSocketService:channelHasSubscription`;
|
|
71
|
+
handler: BackendWebSocketService['channelHasSubscription'];
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Finds all subscriptions that have channels starting with the specified prefix
|
|
75
|
+
*
|
|
76
|
+
* @param channelPrefix - The channel prefix to search for (e.g., "account-activity.v1")
|
|
77
|
+
* @returns Array of subscription info for matching subscriptions
|
|
78
|
+
*/
|
|
79
|
+
export type BackendWebSocketServiceFindSubscriptionsByChannelPrefixAction = {
|
|
80
|
+
type: `BackendWebSocketService:findSubscriptionsByChannelPrefix`;
|
|
81
|
+
handler: BackendWebSocketService['findSubscriptionsByChannelPrefix'];
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Register a callback for specific channels
|
|
85
|
+
*
|
|
86
|
+
* @param options - Channel callback configuration
|
|
87
|
+
* @param options.channelName - Channel name to match exactly
|
|
88
|
+
* @param options.callback - Function to call when channel matches
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```typescript
|
|
92
|
+
* // Listen to specific account activity channel
|
|
93
|
+
* webSocketService.addChannelCallback({
|
|
94
|
+
* channelName: 'account-activity.v1.eip155:0:0x1234...',
|
|
95
|
+
* callback: (notification) => {
|
|
96
|
+
* console.log('Account activity:', notification.data);
|
|
97
|
+
* }
|
|
98
|
+
* });
|
|
99
|
+
*
|
|
100
|
+
* // Listen to system notifications channel
|
|
101
|
+
* webSocketService.addChannelCallback({
|
|
102
|
+
* channelName: 'system-notifications.v1',
|
|
103
|
+
* callback: (notification) => {
|
|
104
|
+
* console.log('System notification:', notification.data);
|
|
105
|
+
* }
|
|
106
|
+
* });
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export type BackendWebSocketServiceAddChannelCallbackAction = {
|
|
110
|
+
type: `BackendWebSocketService:addChannelCallback`;
|
|
111
|
+
handler: BackendWebSocketService['addChannelCallback'];
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Remove a channel callback
|
|
115
|
+
*
|
|
116
|
+
* @param channelName - The channel name to remove callback for
|
|
117
|
+
* @returns True if callback was found and removed, false otherwise
|
|
118
|
+
*/
|
|
119
|
+
export type BackendWebSocketServiceRemoveChannelCallbackAction = {
|
|
120
|
+
type: `BackendWebSocketService:removeChannelCallback`;
|
|
121
|
+
handler: BackendWebSocketService['removeChannelCallback'];
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Get all registered channel callbacks (for debugging)
|
|
125
|
+
*/
|
|
126
|
+
export type BackendWebSocketServiceGetChannelCallbacksAction = {
|
|
127
|
+
type: `BackendWebSocketService:getChannelCallbacks`;
|
|
128
|
+
handler: BackendWebSocketService['getChannelCallbacks'];
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Create and manage a subscription with direct callback routing
|
|
132
|
+
*
|
|
133
|
+
* @param options - Subscription configuration
|
|
134
|
+
* @param options.channels - Array of channel names to subscribe to
|
|
135
|
+
* @param options.callback - Callback function for handling notifications
|
|
136
|
+
* @returns Promise that resolves with subscription object containing unsubscribe method
|
|
137
|
+
*/
|
|
138
|
+
export type BackendWebSocketServiceSubscribeAction = {
|
|
139
|
+
type: `BackendWebSocketService:subscribe`;
|
|
140
|
+
handler: BackendWebSocketService['subscribe'];
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Union of all BackendWebSocketService action types.
|
|
144
|
+
*/
|
|
145
|
+
export type BackendWebSocketServiceMethodActions = BackendWebSocketServiceConnectAction | BackendWebSocketServiceDisconnectAction | BackendWebSocketServiceSendMessageAction | BackendWebSocketServiceSendRequestAction | BackendWebSocketServiceGetConnectionInfoAction | BackendWebSocketServiceGetSubscriptionsByChannelAction | BackendWebSocketServiceChannelHasSubscriptionAction | BackendWebSocketServiceFindSubscriptionsByChannelPrefixAction | BackendWebSocketServiceAddChannelCallbackAction | BackendWebSocketServiceRemoveChannelCallbackAction | BackendWebSocketServiceGetChannelCallbacksAction | BackendWebSocketServiceSubscribeAction;
|
|
146
|
+
//# sourceMappingURL=BackendWebSocketService-method-action-types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackendWebSocketService-method-action-types.d.cts","sourceRoot":"","sources":["../src/BackendWebSocketService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,sCAAkC;AAEzE;;;;GAIG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,uCAAuC,GAAG;IACpD,IAAI,EAAE,oCAAoC,CAAC;IAC3C,OAAO,EAAE,uBAAuB,CAAC,YAAY,CAAC,CAAC;CAChD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,uBAAuB,CAAC,aAAa,CAAC,CAAC;CACjD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,uBAAuB,CAAC,aAAa,CAAC,CAAC;CACjD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,8CAA8C,GAAG;IAC3D,IAAI,EAAE,2CAA2C,CAAC;IAClD,OAAO,EAAE,uBAAuB,CAAC,mBAAmB,CAAC,CAAC;CACvD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,sDAAsD,GAAG;IACnE,IAAI,EAAE,mDAAmD,CAAC;IAC1D,OAAO,EAAE,uBAAuB,CAAC,2BAA2B,CAAC,CAAC;CAC/D,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,mDAAmD,GAAG;IAChE,IAAI,EAAE,gDAAgD,CAAC;IACvD,OAAO,EAAE,uBAAuB,CAAC,wBAAwB,CAAC,CAAC;CAC5D,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,6DAA6D,GAAG;IAC1E,IAAI,EAAE,0DAA0D,CAAC;IACjE,OAAO,EAAE,uBAAuB,CAAC,kCAAkC,CAAC,CAAC;CACtE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,4CAA4C,CAAC;IACnD,OAAO,EAAE,uBAAuB,CAAC,oBAAoB,CAAC,CAAC;CACxD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,kDAAkD,GAAG;IAC/D,IAAI,EAAE,+CAA+C,CAAC;IACtD,OAAO,EAAE,uBAAuB,CAAC,uBAAuB,CAAC,CAAC;CAC3D,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gDAAgD,GAAG;IAC7D,IAAI,EAAE,6CAA6C,CAAC;IACpD,OAAO,EAAE,uBAAuB,CAAC,qBAAqB,CAAC,CAAC;CACzD,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,sCAAsC,GAAG;IACnD,IAAI,EAAE,mCAAmC,CAAC;IAC1C,OAAO,EAAE,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAC/C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oCAAoC,GAC5C,oCAAoC,GACpC,uCAAuC,GACvC,wCAAwC,GACxC,wCAAwC,GACxC,8CAA8C,GAC9C,sDAAsD,GACtD,mDAAmD,GACnD,6DAA6D,GAC7D,+CAA+C,GAC/C,kDAAkD,GAClD,gDAAgD,GAChD,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto generated by `scripts/generate-method-action-types.ts`.
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
*/
|
|
5
|
+
import type { BackendWebSocketService } from "./BackendWebSocketService.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* Establishes WebSocket connection
|
|
8
|
+
*
|
|
9
|
+
* @returns Promise that resolves when connection is established
|
|
10
|
+
*/
|
|
11
|
+
export type BackendWebSocketServiceConnectAction = {
|
|
12
|
+
type: `BackendWebSocketService:connect`;
|
|
13
|
+
handler: BackendWebSocketService['connect'];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Closes WebSocket connection
|
|
17
|
+
*
|
|
18
|
+
* @returns Promise that resolves when disconnection is complete
|
|
19
|
+
*/
|
|
20
|
+
export type BackendWebSocketServiceDisconnectAction = {
|
|
21
|
+
type: `BackendWebSocketService:disconnect`;
|
|
22
|
+
handler: BackendWebSocketService['disconnect'];
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Sends a message through the WebSocket
|
|
26
|
+
*
|
|
27
|
+
* @param message - The message to send
|
|
28
|
+
* @returns Promise that resolves when message is sent
|
|
29
|
+
*/
|
|
30
|
+
export type BackendWebSocketServiceSendMessageAction = {
|
|
31
|
+
type: `BackendWebSocketService:sendMessage`;
|
|
32
|
+
handler: BackendWebSocketService['sendMessage'];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Sends a request and waits for a correlated response
|
|
36
|
+
*
|
|
37
|
+
* @param message - The request message
|
|
38
|
+
* @returns Promise that resolves with the response data
|
|
39
|
+
*/
|
|
40
|
+
export type BackendWebSocketServiceSendRequestAction = {
|
|
41
|
+
type: `BackendWebSocketService:sendRequest`;
|
|
42
|
+
handler: BackendWebSocketService['sendRequest'];
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Gets current connection information
|
|
46
|
+
*
|
|
47
|
+
* @returns Current connection status and details
|
|
48
|
+
*/
|
|
49
|
+
export type BackendWebSocketServiceGetConnectionInfoAction = {
|
|
50
|
+
type: `BackendWebSocketService:getConnectionInfo`;
|
|
51
|
+
handler: BackendWebSocketService['getConnectionInfo'];
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Gets all subscription information for a specific channel
|
|
55
|
+
*
|
|
56
|
+
* @param channel - The channel name to look up
|
|
57
|
+
* @returns Array of subscription details for all subscriptions containing the channel
|
|
58
|
+
*/
|
|
59
|
+
export type BackendWebSocketServiceGetSubscriptionsByChannelAction = {
|
|
60
|
+
type: `BackendWebSocketService:getSubscriptionsByChannel`;
|
|
61
|
+
handler: BackendWebSocketService['getSubscriptionsByChannel'];
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Checks if a channel has a subscription
|
|
65
|
+
*
|
|
66
|
+
* @param channel - The channel name to check
|
|
67
|
+
* @returns True if the channel has a subscription, false otherwise
|
|
68
|
+
*/
|
|
69
|
+
export type BackendWebSocketServiceChannelHasSubscriptionAction = {
|
|
70
|
+
type: `BackendWebSocketService:channelHasSubscription`;
|
|
71
|
+
handler: BackendWebSocketService['channelHasSubscription'];
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Finds all subscriptions that have channels starting with the specified prefix
|
|
75
|
+
*
|
|
76
|
+
* @param channelPrefix - The channel prefix to search for (e.g., "account-activity.v1")
|
|
77
|
+
* @returns Array of subscription info for matching subscriptions
|
|
78
|
+
*/
|
|
79
|
+
export type BackendWebSocketServiceFindSubscriptionsByChannelPrefixAction = {
|
|
80
|
+
type: `BackendWebSocketService:findSubscriptionsByChannelPrefix`;
|
|
81
|
+
handler: BackendWebSocketService['findSubscriptionsByChannelPrefix'];
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Register a callback for specific channels
|
|
85
|
+
*
|
|
86
|
+
* @param options - Channel callback configuration
|
|
87
|
+
* @param options.channelName - Channel name to match exactly
|
|
88
|
+
* @param options.callback - Function to call when channel matches
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```typescript
|
|
92
|
+
* // Listen to specific account activity channel
|
|
93
|
+
* webSocketService.addChannelCallback({
|
|
94
|
+
* channelName: 'account-activity.v1.eip155:0:0x1234...',
|
|
95
|
+
* callback: (notification) => {
|
|
96
|
+
* console.log('Account activity:', notification.data);
|
|
97
|
+
* }
|
|
98
|
+
* });
|
|
99
|
+
*
|
|
100
|
+
* // Listen to system notifications channel
|
|
101
|
+
* webSocketService.addChannelCallback({
|
|
102
|
+
* channelName: 'system-notifications.v1',
|
|
103
|
+
* callback: (notification) => {
|
|
104
|
+
* console.log('System notification:', notification.data);
|
|
105
|
+
* }
|
|
106
|
+
* });
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export type BackendWebSocketServiceAddChannelCallbackAction = {
|
|
110
|
+
type: `BackendWebSocketService:addChannelCallback`;
|
|
111
|
+
handler: BackendWebSocketService['addChannelCallback'];
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Remove a channel callback
|
|
115
|
+
*
|
|
116
|
+
* @param channelName - The channel name to remove callback for
|
|
117
|
+
* @returns True if callback was found and removed, false otherwise
|
|
118
|
+
*/
|
|
119
|
+
export type BackendWebSocketServiceRemoveChannelCallbackAction = {
|
|
120
|
+
type: `BackendWebSocketService:removeChannelCallback`;
|
|
121
|
+
handler: BackendWebSocketService['removeChannelCallback'];
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Get all registered channel callbacks (for debugging)
|
|
125
|
+
*/
|
|
126
|
+
export type BackendWebSocketServiceGetChannelCallbacksAction = {
|
|
127
|
+
type: `BackendWebSocketService:getChannelCallbacks`;
|
|
128
|
+
handler: BackendWebSocketService['getChannelCallbacks'];
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Create and manage a subscription with direct callback routing
|
|
132
|
+
*
|
|
133
|
+
* @param options - Subscription configuration
|
|
134
|
+
* @param options.channels - Array of channel names to subscribe to
|
|
135
|
+
* @param options.callback - Callback function for handling notifications
|
|
136
|
+
* @returns Promise that resolves with subscription object containing unsubscribe method
|
|
137
|
+
*/
|
|
138
|
+
export type BackendWebSocketServiceSubscribeAction = {
|
|
139
|
+
type: `BackendWebSocketService:subscribe`;
|
|
140
|
+
handler: BackendWebSocketService['subscribe'];
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Union of all BackendWebSocketService action types.
|
|
144
|
+
*/
|
|
145
|
+
export type BackendWebSocketServiceMethodActions = BackendWebSocketServiceConnectAction | BackendWebSocketServiceDisconnectAction | BackendWebSocketServiceSendMessageAction | BackendWebSocketServiceSendRequestAction | BackendWebSocketServiceGetConnectionInfoAction | BackendWebSocketServiceGetSubscriptionsByChannelAction | BackendWebSocketServiceChannelHasSubscriptionAction | BackendWebSocketServiceFindSubscriptionsByChannelPrefixAction | BackendWebSocketServiceAddChannelCallbackAction | BackendWebSocketServiceRemoveChannelCallbackAction | BackendWebSocketServiceGetChannelCallbacksAction | BackendWebSocketServiceSubscribeAction;
|
|
146
|
+
//# sourceMappingURL=BackendWebSocketService-method-action-types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackendWebSocketService-method-action-types.d.mts","sourceRoot":"","sources":["../src/BackendWebSocketService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,sCAAkC;AAEzE;;;;GAIG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,uCAAuC,GAAG;IACpD,IAAI,EAAE,oCAAoC,CAAC;IAC3C,OAAO,EAAE,uBAAuB,CAAC,YAAY,CAAC,CAAC;CAChD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,uBAAuB,CAAC,aAAa,CAAC,CAAC;CACjD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,uBAAuB,CAAC,aAAa,CAAC,CAAC;CACjD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,8CAA8C,GAAG;IAC3D,IAAI,EAAE,2CAA2C,CAAC;IAClD,OAAO,EAAE,uBAAuB,CAAC,mBAAmB,CAAC,CAAC;CACvD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,sDAAsD,GAAG;IACnE,IAAI,EAAE,mDAAmD,CAAC;IAC1D,OAAO,EAAE,uBAAuB,CAAC,2BAA2B,CAAC,CAAC;CAC/D,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,mDAAmD,GAAG;IAChE,IAAI,EAAE,gDAAgD,CAAC;IACvD,OAAO,EAAE,uBAAuB,CAAC,wBAAwB,CAAC,CAAC;CAC5D,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,6DAA6D,GAAG;IAC1E,IAAI,EAAE,0DAA0D,CAAC;IACjE,OAAO,EAAE,uBAAuB,CAAC,kCAAkC,CAAC,CAAC;CACtE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,4CAA4C,CAAC;IACnD,OAAO,EAAE,uBAAuB,CAAC,oBAAoB,CAAC,CAAC;CACxD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,kDAAkD,GAAG;IAC/D,IAAI,EAAE,+CAA+C,CAAC;IACtD,OAAO,EAAE,uBAAuB,CAAC,uBAAuB,CAAC,CAAC;CAC3D,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gDAAgD,GAAG;IAC7D,IAAI,EAAE,6CAA6C,CAAC;IACpD,OAAO,EAAE,uBAAuB,CAAC,qBAAqB,CAAC,CAAC;CACzD,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,sCAAsC,GAAG;IACnD,IAAI,EAAE,mCAAmC,CAAC;IAC1C,OAAO,EAAE,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAC/C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oCAAoC,GAC5C,oCAAoC,GACpC,uCAAuC,GACvC,wCAAwC,GACxC,wCAAwC,GACxC,8CAA8C,GAC9C,sDAAsD,GACtD,mDAAmD,GACnD,6DAA6D,GAC7D,+CAA+C,GAC/C,kDAAkD,GAClD,gDAAgD,GAChD,sCAAsC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackendWebSocketService-method-action-types.mjs","sourceRoot":"","sources":["../src/BackendWebSocketService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated by `scripts/generate-method-action-types.ts`.\n * Do not edit manually.\n */\n\nimport type { BackendWebSocketService } from './BackendWebSocketService';\n\n/**\n * Establishes WebSocket connection\n *\n * @returns Promise that resolves when connection is established\n */\nexport type BackendWebSocketServiceConnectAction = {\n type: `BackendWebSocketService:connect`;\n handler: BackendWebSocketService['connect'];\n};\n\n/**\n * Closes WebSocket connection\n *\n * @returns Promise that resolves when disconnection is complete\n */\nexport type BackendWebSocketServiceDisconnectAction = {\n type: `BackendWebSocketService:disconnect`;\n handler: BackendWebSocketService['disconnect'];\n};\n\n/**\n * Sends a message through the WebSocket\n *\n * @param message - The message to send\n * @returns Promise that resolves when message is sent\n */\nexport type BackendWebSocketServiceSendMessageAction = {\n type: `BackendWebSocketService:sendMessage`;\n handler: BackendWebSocketService['sendMessage'];\n};\n\n/**\n * Sends a request and waits for a correlated response\n *\n * @param message - The request message\n * @returns Promise that resolves with the response data\n */\nexport type BackendWebSocketServiceSendRequestAction = {\n type: `BackendWebSocketService:sendRequest`;\n handler: BackendWebSocketService['sendRequest'];\n};\n\n/**\n * Gets current connection information\n *\n * @returns Current connection status and details\n */\nexport type BackendWebSocketServiceGetConnectionInfoAction = {\n type: `BackendWebSocketService:getConnectionInfo`;\n handler: BackendWebSocketService['getConnectionInfo'];\n};\n\n/**\n * Gets all subscription information for a specific channel\n *\n * @param channel - The channel name to look up\n * @returns Array of subscription details for all subscriptions containing the channel\n */\nexport type BackendWebSocketServiceGetSubscriptionsByChannelAction = {\n type: `BackendWebSocketService:getSubscriptionsByChannel`;\n handler: BackendWebSocketService['getSubscriptionsByChannel'];\n};\n\n/**\n * Checks if a channel has a subscription\n *\n * @param channel - The channel name to check\n * @returns True if the channel has a subscription, false otherwise\n */\nexport type BackendWebSocketServiceChannelHasSubscriptionAction = {\n type: `BackendWebSocketService:channelHasSubscription`;\n handler: BackendWebSocketService['channelHasSubscription'];\n};\n\n/**\n * Finds all subscriptions that have channels starting with the specified prefix\n *\n * @param channelPrefix - The channel prefix to search for (e.g., \"account-activity.v1\")\n * @returns Array of subscription info for matching subscriptions\n */\nexport type BackendWebSocketServiceFindSubscriptionsByChannelPrefixAction = {\n type: `BackendWebSocketService:findSubscriptionsByChannelPrefix`;\n handler: BackendWebSocketService['findSubscriptionsByChannelPrefix'];\n};\n\n/**\n * Register a callback for specific channels\n *\n * @param options - Channel callback configuration\n * @param options.channelName - Channel name to match exactly\n * @param options.callback - Function to call when channel matches\n *\n * @example\n * ```typescript\n * // Listen to specific account activity channel\n * webSocketService.addChannelCallback({\n * channelName: 'account-activity.v1.eip155:0:0x1234...',\n * callback: (notification) => {\n * console.log('Account activity:', notification.data);\n * }\n * });\n *\n * // Listen to system notifications channel\n * webSocketService.addChannelCallback({\n * channelName: 'system-notifications.v1',\n * callback: (notification) => {\n * console.log('System notification:', notification.data);\n * }\n * });\n * ```\n */\nexport type BackendWebSocketServiceAddChannelCallbackAction = {\n type: `BackendWebSocketService:addChannelCallback`;\n handler: BackendWebSocketService['addChannelCallback'];\n};\n\n/**\n * Remove a channel callback\n *\n * @param channelName - The channel name to remove callback for\n * @returns True if callback was found and removed, false otherwise\n */\nexport type BackendWebSocketServiceRemoveChannelCallbackAction = {\n type: `BackendWebSocketService:removeChannelCallback`;\n handler: BackendWebSocketService['removeChannelCallback'];\n};\n\n/**\n * Get all registered channel callbacks (for debugging)\n */\nexport type BackendWebSocketServiceGetChannelCallbacksAction = {\n type: `BackendWebSocketService:getChannelCallbacks`;\n handler: BackendWebSocketService['getChannelCallbacks'];\n};\n\n/**\n * Create and manage a subscription with direct callback routing\n *\n * @param options - Subscription configuration\n * @param options.channels - Array of channel names to subscribe to\n * @param options.callback - Callback function for handling notifications\n * @returns Promise that resolves with subscription object containing unsubscribe method\n */\nexport type BackendWebSocketServiceSubscribeAction = {\n type: `BackendWebSocketService:subscribe`;\n handler: BackendWebSocketService['subscribe'];\n};\n\n/**\n * Union of all BackendWebSocketService action types.\n */\nexport type BackendWebSocketServiceMethodActions =\n | BackendWebSocketServiceConnectAction\n | BackendWebSocketServiceDisconnectAction\n | BackendWebSocketServiceSendMessageAction\n | BackendWebSocketServiceSendRequestAction\n | BackendWebSocketServiceGetConnectionInfoAction\n | BackendWebSocketServiceGetSubscriptionsByChannelAction\n | BackendWebSocketServiceChannelHasSubscriptionAction\n | BackendWebSocketServiceFindSubscriptionsByChannelPrefixAction\n | BackendWebSocketServiceAddChannelCallbackAction\n | BackendWebSocketServiceRemoveChannelCallbackAction\n | BackendWebSocketServiceGetChannelCallbacksAction\n | BackendWebSocketServiceSubscribeAction;\n"]}
|