Skip to content

Commit b277486

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

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

lib/og.js

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

270270
OG.prototype.queryContract = function(data){
271-
var url = this.currentProvider.host;
272271
var method = "/queryContract";
272+
var options = {
273+
method: 'POST',
274+
url: this.currentProvider.host + method,
275+
headers: {
276+
'content-type': 'application/json'
277+
},
278+
body: data,
279+
json: true
280+
}
273281
return new promise(function(resolve,reject){
274-
request.post({url: url + method, form: data}, function(error,httpResponse,body){
282+
request(options, function (error, httpResponse, body) {
275283
if (error){
276284
reject("err:",error)
277285
}else{

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.61",
3+
"version": "0.2.7",
44
"description": "Node.js scraper module for og DAG chain",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)