Skip to content

Commit fcc108b

Browse files
committed
[email protected] | general update. support query contract.
1 parent 0898fad commit fcc108b

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

lib/og.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -267,18 +267,18 @@ OG.prototype.getBalance = function(address){
267267
});
268268
}
269269

270-
OG.prototype.queryContract = function(address, data){
270+
OG.prototype.queryContract = function(data){
271271
var url = this.currentProvider.host;
272-
var method = "/query_contract?address=" + address + "&data=" + data;
272+
var method = "/queryContract";
273273
return new promise(function(resolve,reject){
274-
request(url+method, function (error, response, body) {
274+
request.post({url: url + method, form: data}, function(error,httpResponse,body){
275275
if (error){
276-
reject(error)
276+
reject("err:",error)
277277
}else{
278-
var result = {};
279-
result.response = response.statusCode;
280-
result.body = body;
281-
resolve(JSON.parse(result.body));
278+
var data = {};
279+
data.httpResponse = httpResponse.statusCode;
280+
data.body = body;
281+
resolve(data)
282282
}
283283
});
284284
});

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "og-sdk",
3-
"version": "0.2.6",
3+
"version": "0.2.61",
44
"description": "Node.js scraper module for og DAG chain",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)