Created
May 26, 2018 17:06
-
-
Save gavxin/b069280655141bdba9bec699437ad4a9 to your computer and use it in GitHub Desktop.
Nebulas helpers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function QueryContract(addr) { | |
var headers = new Headers(); | |
headers.append('Content-Type', 'application/json') | |
fetch("https://mainnet.nebulas.io/v1/user/getTransactionByContract", { | |
method: 'POST', | |
headers: headers, | |
body: '{"address":"' + addr + '"}' | |
}).then(resp => { | |
return resp.json(); | |
}).then(json => { | |
// console.log(json); | |
console.log("Contract txhash is:" + json.result.hash); | |
window.open("https://explorer.nebulas.io/#/tx/" + json.result.hash); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment