weavedb-node-client 0.18.6 → 0.18.8
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/index.js +11 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -105,8 +105,13 @@ class SDK extends Base {
|
|
|
105
105
|
ret({ result: null, err })
|
|
106
106
|
} else {
|
|
107
107
|
if (response.err === "") {
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
try {
|
|
109
|
+
const result =
|
|
110
|
+
response.result === "" ? null : JSON.parse(response.result)
|
|
111
|
+
ret({ result, err: null })
|
|
112
|
+
} catch (e) {
|
|
113
|
+
ret({ result: null, err: e })
|
|
114
|
+
}
|
|
110
115
|
} else {
|
|
111
116
|
ret({ result: null, err: response.err })
|
|
112
117
|
}
|
|
@@ -132,6 +137,10 @@ class SDK extends Base {
|
|
|
132
137
|
async getNonce(addr) {
|
|
133
138
|
return this.readQuery("getNonce", addr, true)
|
|
134
139
|
}
|
|
140
|
+
|
|
141
|
+
async admin(op, opt) {
|
|
142
|
+
return this._write2("admin", op, opt)
|
|
143
|
+
}
|
|
135
144
|
}
|
|
136
145
|
|
|
137
146
|
module.exports = SDK
|