wao 0.2.3 → 0.3.0

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.
@@ -0,0 +1,53 @@
1
+ local drive = { _version = "0.0.1" }
2
+
3
+ function drive.getBlock(height)
4
+ local block = io.open("/block/" .. height)
5
+ if not block then
6
+ return nil, "Block Header not found!"
7
+ end
8
+ local headers = require('json').decode(
9
+ block:read(
10
+ block:seek('end')
11
+ )
12
+ )
13
+ block:close()
14
+ return headers
15
+ end
16
+
17
+ function drive.getTx(txId)
18
+ local file = io.open('/tx/' .. txId)
19
+ if not file then
20
+ return nil, "File not found!"
21
+ end
22
+ local contents = require('json').decode(
23
+ file:read(
24
+ file:seek('end')
25
+ )
26
+ )
27
+ file:close()
28
+ return contents
29
+ end
30
+
31
+ function drive.getData(txId)
32
+ local file = io.open('/data/' .. txId)
33
+ if not file then
34
+ return nil, "File not found!"
35
+ end
36
+ local contents = file:read(
37
+ file:seek('end')
38
+ )
39
+ file:close()
40
+ return contents
41
+ end
42
+
43
+ function drive.getDataItem(txId)
44
+ local file = io.open('/tx2/' .. txId)
45
+ if not file then
46
+ return nil, "File not found!"
47
+ end
48
+ local contents = file:read(
49
+ file:seek('end')
50
+ )
51
+ file:close()
52
+ return contents
53
+ end
package/esm/tao.js CHANGED
@@ -16,9 +16,11 @@ class AO extends MAO {
16
16
  message,
17
17
  spawn,
18
18
  dryrun,
19
+ monitor,
20
+ unmonitor,
19
21
  txs,
20
22
  } = connect()
21
- this.module = modules.aos_2_0_1
23
+ this.module = modules.aos2_0_1
22
24
  this.assign = assign
23
25
  this.result = result
24
26
  this.results = results
@@ -26,6 +28,8 @@ class AO extends MAO {
26
28
  this.spawn = spawn
27
29
  this.dryrun = dryrun
28
30
  this.ar.txs = txs
31
+ this.monitor = monitor
32
+ this.unmonitor = unmonitor
29
33
  this.accounts = accounts
30
34
  }
31
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wao",
3
- "version": "0.2.3",
3
+ "version": "0.3.0",
4
4
  "description": "",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",