@tchain/tcabci-read-js-client 1.3.6 → 1.3.9
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/client.js +9 -3
- package/client_test.js +5 -0
- package/package.json +4 -4
package/client.js
CHANGED
|
@@ -18,7 +18,7 @@ class TCAbciClient {
|
|
|
18
18
|
subscribed = false
|
|
19
19
|
subscribedAddresses = []
|
|
20
20
|
connected = false
|
|
21
|
-
version = "v1.3.
|
|
21
|
+
version = "v1.3.9"
|
|
22
22
|
errorCb = null
|
|
23
23
|
listenCb = null
|
|
24
24
|
ws = null
|
|
@@ -26,7 +26,12 @@ class TCAbciClient {
|
|
|
26
26
|
readNodeAddress = READ_NODE_ADDRESS
|
|
27
27
|
readNodeWSAddress = READ_NODE_WS_ADDRESS
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @param {Array<String>} readNodeAddresses
|
|
32
|
+
* @param axiosAdapter Axios Adapter
|
|
33
|
+
*/
|
|
34
|
+
constructor(readNodeAddresses = [], axiosAdapter = null) {
|
|
30
35
|
if (readNodeAddresses.length === 2) {
|
|
31
36
|
this.readNodeAddress = readNodeAddresses[0]
|
|
32
37
|
this.readNodeWSAddress = readNodeAddresses[1]
|
|
@@ -34,7 +39,8 @@ class TCAbciClient {
|
|
|
34
39
|
this.httpClient = axios.create({
|
|
35
40
|
baseURL: this.readNodeAddress,
|
|
36
41
|
timeout: 10000,
|
|
37
|
-
headers: {'Client': `tcabaci-read-js-client${this.version}`}
|
|
42
|
+
headers: {'Client': `tcabaci-read-js-client${this.version}`},
|
|
43
|
+
...(axiosAdapter ? { adapter: axiosAdapter } : {})
|
|
38
44
|
})
|
|
39
45
|
}
|
|
40
46
|
Socket() {
|
package/client_test.js
CHANGED
|
@@ -79,6 +79,7 @@ describe("TCAbciClient TESTS", () => {
|
|
|
79
79
|
client.Start()
|
|
80
80
|
.then(() => {
|
|
81
81
|
client.Subscribe(["2mSCzresfg8Gwu7LZ9k9BTWkQAcQEkvYHFUSCZE2ubM4QV89PTeSYwQDqBas3ykq2emHEK6VRvxdgoe1vrhBbQGN"], ['invalid'])
|
|
82
|
+
done(new Error("invalid"))
|
|
82
83
|
})
|
|
83
84
|
.catch(() => {
|
|
84
85
|
done()
|
|
@@ -93,6 +94,8 @@ describe("TCAbciClient TESTS", () => {
|
|
|
93
94
|
const { connected, subscribed } = client.Status()
|
|
94
95
|
unitJS.assert.equal(connected, true)
|
|
95
96
|
unitJS.assert.equal(subscribed, true)
|
|
97
|
+
|
|
98
|
+
return Promise.resolve()
|
|
96
99
|
})
|
|
97
100
|
.then(() => {
|
|
98
101
|
client.Unsubscribe()
|
|
@@ -164,6 +167,8 @@ describe("TCAbciClient TESTS", () => {
|
|
|
164
167
|
sender_addr: "",
|
|
165
168
|
recipient_addr: ""
|
|
166
169
|
})
|
|
170
|
+
|
|
171
|
+
done(new Error('invalid'))
|
|
167
172
|
} catch (err) {
|
|
168
173
|
unitJS.assert.equal(TRANSACTION_TYPE_NOT_VALID, err)
|
|
169
174
|
done()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tchain/tcabci-read-js-client",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.9",
|
|
4
4
|
"description": "TransferChain Fastest Read Network WebSocket Client",
|
|
5
5
|
"main": "client.js",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
|
-
"url": "https://github.com/TransferChain/tcabci-read-js-client.git"
|
|
13
|
+
"url": "git+https://github.com/TransferChain/tcabci-read-js-client.git"
|
|
14
14
|
},
|
|
15
15
|
"author": "TransferChain A.G <info@transferchain.io>",
|
|
16
16
|
"license": "Apache-2.0",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"unit.js": "^2.1.1"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"axios": "^1.
|
|
27
|
+
"axios": "^1.7.2",
|
|
28
28
|
"reconnecting-websocket": "^4.4.0",
|
|
29
|
-
"ws": "^8.
|
|
29
|
+
"ws": "^8.18.0"
|
|
30
30
|
}
|
|
31
31
|
}
|