@solana-mobile/mobile-wallet-adapter-protocol 2.0.1 → 2.1.0-alpha1
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/android/build.gradle +3 -3
- package/android/src/main/java/com/solanamobile/mobilewalletadapter/reactnative/SolanaMobileWalletAdapterModule.kt +17 -15
- package/lib/cjs/index.browser.js +290 -81
- package/lib/cjs/index.js +290 -81
- package/lib/cjs/index.native.js +180 -28
- package/lib/esm/index.browser.js +288 -82
- package/lib/esm/index.js +288 -82
- package/lib/types/index.browser.d.ts +68 -5
- package/lib/types/index.browser.d.ts.map +1 -1
- package/lib/types/index.d.ts +68 -5
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.native.d.ts +68 -5
- package/lib/types/index.native.d.ts.map +1 -1
- package/package.json +10 -2
- package/src/__forks__/react-native/base64Utils.ts +1 -0
- package/src/__forks__/react-native/transact.ts +92 -106
- package/src/base64Utils.ts +3 -0
- package/src/createMobileWalletProxy.ts +175 -0
- package/src/createSIWSMessage.ts +14 -0
- package/src/encryptedMessage.ts +60 -0
- package/src/errors.ts +95 -93
- package/src/getAssociateAndroidIntentURL.ts +57 -52
- package/src/jsonRpcMessage.ts +38 -81
- package/src/parseHelloRsp.ts +46 -44
- package/src/parseSessionProps.ts +33 -0
- package/src/transact.ts +266 -268
- package/src/types.ts +74 -4
package/src/transact.ts
CHANGED
|
@@ -1,268 +1,266 @@
|
|
|
1
|
-
import createHelloReq from './createHelloReq.js';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
| { __type: '
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
disposeSocket();
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
lastKnownInboundSequenceNumber
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
socket
|
|
254
|
-
socket.addEventListener('
|
|
255
|
-
socket.addEventListener('
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
socket.removeEventListener('
|
|
261
|
-
socket.removeEventListener('
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
});
|
|
268
|
-
}
|
|
1
|
+
import createHelloReq from './createHelloReq.js';
|
|
2
|
+
import createMobileWalletProxy from './createMobileWalletProxy.js';
|
|
3
|
+
import { SEQUENCE_NUMBER_BYTES } from './createSequenceNumberVector.js';
|
|
4
|
+
import { ENCODED_PUBLIC_KEY_LENGTH_BYTES } from './encryptedMessage.js';
|
|
5
|
+
import {
|
|
6
|
+
SolanaMobileWalletAdapterError,
|
|
7
|
+
SolanaMobileWalletAdapterErrorCode,
|
|
8
|
+
SolanaMobileWalletAdapterProtocolError,
|
|
9
|
+
} from './errors.js';
|
|
10
|
+
import generateAssociationKeypair from './generateAssociationKeypair.js';
|
|
11
|
+
import generateECDHKeypair from './generateECDHKeypair.js';
|
|
12
|
+
import { decryptJsonRpcMessage, encryptJsonRpcMessage } from './jsonRpcMessage.js';
|
|
13
|
+
import parseHelloRsp, { SharedSecret } from './parseHelloRsp.js';
|
|
14
|
+
import parseSessionProps from './parseSessionProps.js';
|
|
15
|
+
import { startSession } from './startSession.js';
|
|
16
|
+
import { AssociationKeypair, MobileWallet, SessionProperties, WalletAssociationConfig } from './types.js';
|
|
17
|
+
|
|
18
|
+
const WEBSOCKET_CONNECTION_CONFIG = {
|
|
19
|
+
/**
|
|
20
|
+
* 300 milliseconds is a generally accepted threshold for what someone
|
|
21
|
+
* would consider an acceptable response time for a user interface
|
|
22
|
+
* after having performed a low-attention tapping task. We set the initial
|
|
23
|
+
* interval at which we wait for the wallet to set up the websocket at
|
|
24
|
+
* half this, as per the Nyquist frequency, with a progressive backoff
|
|
25
|
+
* sequence from there. The total wait time is 30s, which allows for the
|
|
26
|
+
* user to be presented with a disambiguation dialog, select a wallet, and
|
|
27
|
+
* for the wallet app to subsequently start.
|
|
28
|
+
*/
|
|
29
|
+
retryDelayScheduleMs: [150, 150, 200, 500, 500, 750, 750, 1000],
|
|
30
|
+
timeoutMs: 30000,
|
|
31
|
+
} as const;
|
|
32
|
+
const WEBSOCKET_PROTOCOL = 'com.solana.mobilewalletadapter.v1';
|
|
33
|
+
|
|
34
|
+
type JsonResponsePromises<T> = Record<
|
|
35
|
+
number,
|
|
36
|
+
Readonly<{ resolve: (value?: T | PromiseLike<T>) => void; reject: (reason?: unknown) => void }>
|
|
37
|
+
>;
|
|
38
|
+
|
|
39
|
+
type State =
|
|
40
|
+
| { __type: 'connected'; sharedSecret: SharedSecret; sessionProperties: SessionProperties }
|
|
41
|
+
| { __type: 'connecting'; associationKeypair: AssociationKeypair }
|
|
42
|
+
| { __type: 'disconnected' }
|
|
43
|
+
| { __type: 'hello_req_sent'; associationPublicKey: CryptoKey; ecdhPrivateKey: CryptoKey };
|
|
44
|
+
|
|
45
|
+
function assertSecureContext() {
|
|
46
|
+
if (typeof window === 'undefined' || window.isSecureContext !== true) {
|
|
47
|
+
throw new SolanaMobileWalletAdapterError(
|
|
48
|
+
SolanaMobileWalletAdapterErrorCode.ERROR_SECURE_CONTEXT_REQUIRED,
|
|
49
|
+
'The mobile wallet adapter protocol must be used in a secure context (`https`).',
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function assertSecureEndpointSpecificURI(walletUriBase: string) {
|
|
55
|
+
let url: URL;
|
|
56
|
+
try {
|
|
57
|
+
url = new URL(walletUriBase);
|
|
58
|
+
} catch {
|
|
59
|
+
throw new SolanaMobileWalletAdapterError(
|
|
60
|
+
SolanaMobileWalletAdapterErrorCode.ERROR_FORBIDDEN_WALLET_BASE_URL,
|
|
61
|
+
'Invalid base URL supplied by wallet',
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
if (url.protocol !== 'https:') {
|
|
65
|
+
throw new SolanaMobileWalletAdapterError(
|
|
66
|
+
SolanaMobileWalletAdapterErrorCode.ERROR_FORBIDDEN_WALLET_BASE_URL,
|
|
67
|
+
'Base URLs supplied by wallets must be valid `https` URLs',
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function getSequenceNumberFromByteArray(byteArray: ArrayBuffer): number {
|
|
73
|
+
const view = new DataView(byteArray);
|
|
74
|
+
return view.getUint32(0, /* littleEndian */ false);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export async function transact<TReturn>(
|
|
78
|
+
callback: (wallet: MobileWallet) => TReturn,
|
|
79
|
+
config?: WalletAssociationConfig,
|
|
80
|
+
): Promise<TReturn> {
|
|
81
|
+
assertSecureContext();
|
|
82
|
+
const associationKeypair = await generateAssociationKeypair();
|
|
83
|
+
const sessionPort = await startSession(associationKeypair.publicKey, config?.baseUri);
|
|
84
|
+
const websocketURL = `ws://localhost:${sessionPort}/solana-wallet`;
|
|
85
|
+
let connectionStartTime: number;
|
|
86
|
+
const getNextRetryDelayMs = (() => {
|
|
87
|
+
const schedule = [...WEBSOCKET_CONNECTION_CONFIG.retryDelayScheduleMs];
|
|
88
|
+
return () => (schedule.length > 1 ? (schedule.shift() as number) : schedule[0]);
|
|
89
|
+
})();
|
|
90
|
+
let nextJsonRpcMessageId = 1;
|
|
91
|
+
let lastKnownInboundSequenceNumber = 0;
|
|
92
|
+
let state: State = { __type: 'disconnected' };
|
|
93
|
+
return new Promise((resolve, reject) => {
|
|
94
|
+
let socket: WebSocket;
|
|
95
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
96
|
+
const jsonRpcResponsePromises: JsonResponsePromises<any> = {};
|
|
97
|
+
const handleOpen = async () => {
|
|
98
|
+
if (state.__type !== 'connecting') {
|
|
99
|
+
console.warn(
|
|
100
|
+
'Expected adapter state to be `connecting` at the moment the websocket opens. ' +
|
|
101
|
+
`Got \`${state.__type}\`.`,
|
|
102
|
+
);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const { associationKeypair } = state;
|
|
106
|
+
socket.removeEventListener('open', handleOpen);
|
|
107
|
+
const ecdhKeypair = await generateECDHKeypair();
|
|
108
|
+
socket.send(await createHelloReq(ecdhKeypair.publicKey, associationKeypair.privateKey));
|
|
109
|
+
state = {
|
|
110
|
+
__type: 'hello_req_sent',
|
|
111
|
+
associationPublicKey: associationKeypair.publicKey,
|
|
112
|
+
ecdhPrivateKey: ecdhKeypair.privateKey,
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
const handleClose = (evt: CloseEvent) => {
|
|
116
|
+
if (evt.wasClean) {
|
|
117
|
+
state = { __type: 'disconnected' };
|
|
118
|
+
} else {
|
|
119
|
+
reject(
|
|
120
|
+
new SolanaMobileWalletAdapterError(
|
|
121
|
+
SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_CLOSED,
|
|
122
|
+
`The wallet session dropped unexpectedly (${evt.code}: ${evt.reason}).`,
|
|
123
|
+
{ closeEvent: evt },
|
|
124
|
+
),
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
disposeSocket();
|
|
128
|
+
};
|
|
129
|
+
const handleError = async (_evt: Event) => {
|
|
130
|
+
disposeSocket();
|
|
131
|
+
if (Date.now() - connectionStartTime >= WEBSOCKET_CONNECTION_CONFIG.timeoutMs) {
|
|
132
|
+
reject(
|
|
133
|
+
new SolanaMobileWalletAdapterError(
|
|
134
|
+
SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_TIMEOUT,
|
|
135
|
+
`Failed to connect to the wallet websocket on port ${sessionPort}.`,
|
|
136
|
+
),
|
|
137
|
+
);
|
|
138
|
+
} else {
|
|
139
|
+
await new Promise((resolve) => {
|
|
140
|
+
const retryDelayMs = getNextRetryDelayMs();
|
|
141
|
+
retryWaitTimeoutId = window.setTimeout(resolve, retryDelayMs);
|
|
142
|
+
});
|
|
143
|
+
attemptSocketConnection();
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
const handleMessage = async (evt: MessageEvent<Blob>) => {
|
|
147
|
+
const responseBuffer = await evt.data.arrayBuffer();
|
|
148
|
+
switch (state.__type) {
|
|
149
|
+
case 'connected':
|
|
150
|
+
try {
|
|
151
|
+
const sequenceNumberVector = responseBuffer.slice(0, SEQUENCE_NUMBER_BYTES);
|
|
152
|
+
const sequenceNumber = getSequenceNumberFromByteArray(sequenceNumberVector);
|
|
153
|
+
if (sequenceNumber !== (lastKnownInboundSequenceNumber + 1)) {
|
|
154
|
+
throw new Error('Encrypted message has invalid sequence number');
|
|
155
|
+
}
|
|
156
|
+
lastKnownInboundSequenceNumber = sequenceNumber;
|
|
157
|
+
const jsonRpcMessage = await decryptJsonRpcMessage(responseBuffer, state.sharedSecret);
|
|
158
|
+
const responsePromise = jsonRpcResponsePromises[jsonRpcMessage.id];
|
|
159
|
+
delete jsonRpcResponsePromises[jsonRpcMessage.id];
|
|
160
|
+
responsePromise.resolve(jsonRpcMessage.result);
|
|
161
|
+
} catch (e) {
|
|
162
|
+
if (e instanceof SolanaMobileWalletAdapterProtocolError) {
|
|
163
|
+
const responsePromise = jsonRpcResponsePromises[e.jsonRpcMessageId];
|
|
164
|
+
delete jsonRpcResponsePromises[e.jsonRpcMessageId];
|
|
165
|
+
responsePromise.reject(e);
|
|
166
|
+
} else {
|
|
167
|
+
throw e;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
break;
|
|
171
|
+
case 'hello_req_sent': {
|
|
172
|
+
const sharedSecret = await parseHelloRsp(
|
|
173
|
+
responseBuffer,
|
|
174
|
+
state.associationPublicKey,
|
|
175
|
+
state.ecdhPrivateKey,
|
|
176
|
+
);
|
|
177
|
+
const sessionPropertiesBuffer = responseBuffer.slice(ENCODED_PUBLIC_KEY_LENGTH_BYTES);
|
|
178
|
+
const sessionProperties = sessionPropertiesBuffer.byteLength !== 0
|
|
179
|
+
? await (async () => {
|
|
180
|
+
const sequenceNumberVector = sessionPropertiesBuffer.slice(0, SEQUENCE_NUMBER_BYTES);
|
|
181
|
+
const sequenceNumber = getSequenceNumberFromByteArray(sequenceNumberVector);
|
|
182
|
+
if (sequenceNumber !== (lastKnownInboundSequenceNumber + 1)) {
|
|
183
|
+
throw new Error('Encrypted message has invalid sequence number');
|
|
184
|
+
}
|
|
185
|
+
lastKnownInboundSequenceNumber = sequenceNumber;
|
|
186
|
+
return parseSessionProps(sessionPropertiesBuffer, sharedSecret);
|
|
187
|
+
})() : <SessionProperties> { protocol_version: 'legacy' };
|
|
188
|
+
state = { __type: 'connected', sharedSecret, sessionProperties };
|
|
189
|
+
const wallet = createMobileWalletProxy(sessionProperties.protocol_version,
|
|
190
|
+
async (method, params) => {
|
|
191
|
+
const id = nextJsonRpcMessageId++;
|
|
192
|
+
socket.send(
|
|
193
|
+
await encryptJsonRpcMessage(
|
|
194
|
+
{
|
|
195
|
+
id,
|
|
196
|
+
jsonrpc: '2.0' as const,
|
|
197
|
+
method,
|
|
198
|
+
params: params ?? {},
|
|
199
|
+
},
|
|
200
|
+
sharedSecret,
|
|
201
|
+
),
|
|
202
|
+
);
|
|
203
|
+
return new Promise((resolve, reject) => {
|
|
204
|
+
jsonRpcResponsePromises[id] = {
|
|
205
|
+
resolve(result) {
|
|
206
|
+
switch (method) {
|
|
207
|
+
case 'authorize':
|
|
208
|
+
case 'reauthorize': {
|
|
209
|
+
const { wallet_uri_base } = result as Awaited<
|
|
210
|
+
ReturnType<MobileWallet['authorize' | 'reauthorize']>
|
|
211
|
+
>;
|
|
212
|
+
if (wallet_uri_base != null) {
|
|
213
|
+
try {
|
|
214
|
+
assertSecureEndpointSpecificURI(wallet_uri_base);
|
|
215
|
+
} catch (e) {
|
|
216
|
+
reject(e);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
resolve(result);
|
|
224
|
+
},
|
|
225
|
+
reject,
|
|
226
|
+
};
|
|
227
|
+
});
|
|
228
|
+
})
|
|
229
|
+
try {
|
|
230
|
+
resolve(await callback(wallet));
|
|
231
|
+
} catch (e) {
|
|
232
|
+
reject(e);
|
|
233
|
+
} finally {
|
|
234
|
+
disposeSocket();
|
|
235
|
+
socket.close();
|
|
236
|
+
}
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
let disposeSocket: () => void;
|
|
242
|
+
let retryWaitTimeoutId: number;
|
|
243
|
+
const attemptSocketConnection = () => {
|
|
244
|
+
if (disposeSocket) {
|
|
245
|
+
disposeSocket();
|
|
246
|
+
}
|
|
247
|
+
state = { __type: 'connecting', associationKeypair };
|
|
248
|
+
if (connectionStartTime === undefined) {
|
|
249
|
+
connectionStartTime = Date.now();
|
|
250
|
+
}
|
|
251
|
+
socket = new WebSocket(websocketURL, [WEBSOCKET_PROTOCOL]);
|
|
252
|
+
socket.addEventListener('open', handleOpen);
|
|
253
|
+
socket.addEventListener('close', handleClose);
|
|
254
|
+
socket.addEventListener('error', handleError);
|
|
255
|
+
socket.addEventListener('message', handleMessage);
|
|
256
|
+
disposeSocket = () => {
|
|
257
|
+
window.clearTimeout(retryWaitTimeoutId);
|
|
258
|
+
socket.removeEventListener('open', handleOpen);
|
|
259
|
+
socket.removeEventListener('close', handleClose);
|
|
260
|
+
socket.removeEventListener('error', handleError);
|
|
261
|
+
socket.removeEventListener('message', handleMessage);
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
attemptSocketConnection();
|
|
265
|
+
});
|
|
266
|
+
}
|