@tchain/tcabci-read-js-client 2.2.2 → 2.2.4

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/client.js +13 -1
  2. package/package.json +1 -1
package/client.js CHANGED
@@ -45,7 +45,7 @@ export default class TCaBCIClient {
45
45
  subscribed = false
46
46
  subscribedAddresses = []
47
47
  connected = false
48
- version = 'v2.2.2'
48
+ version = 'v2.2.4'
49
49
  /**
50
50
  * @type {?successCallback}
51
51
  */
@@ -236,6 +236,18 @@ export default class TCaBCIClient {
236
236
  .catch((e) => this.handleRestError(e, BLOCK_NOT_FOUND))
237
237
  }
238
238
 
239
+ Tx(id) {
240
+ if (!id || typeof id !== 'string') {
241
+ return Promise.reject(INVALID_ARGUMENTS)
242
+ }
243
+
244
+ return this.httpClient(`/v1/tx/${id}`, { method: 'GET' })
245
+ .then((res) => {
246
+ return { tx: res.data }
247
+ })
248
+ .catch((e) => this.handleRestError(e))
249
+ }
250
+
239
251
  /**
240
252
  * @param {?Array<string>} recipientAddrs
241
253
  * @param {?Array<string>} senderAddrs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tchain/tcabci-read-js-client",
3
- "version": "2.2.2",
3
+ "version": "2.2.4",
4
4
  "description": "TransferChain Fastest Read Network WebSocket Client",
5
5
  "main": "client.js",
6
6
  "type": "module",