forked from cerc-io/plugeth
Changed getkey and secrettoaddress
This commit is contained in:
parent
dd45197bcd
commit
91824af46b
@ -36,11 +36,14 @@ window.eth = {
|
||||
postData({call: "getKey"}, cb);
|
||||
},
|
||||
|
||||
|
||||
getBalanceAt: function(address, cb) {
|
||||
postData({call: "getBalance", args: [address]}, cb);
|
||||
},
|
||||
|
||||
getSecretToAddress: function(sec, cb) {
|
||||
postData({call: "getSecretToAddress", args: [sec]}, cb);
|
||||
},
|
||||
|
||||
watch: function(address, storageAddrOrCb, cb) {
|
||||
var ev;
|
||||
if(cb === undefined) {
|
||||
|
@ -81,8 +81,9 @@ ApplicationWindow {
|
||||
|
||||
break
|
||||
case "getKey":
|
||||
var keys = eth.getKey()
|
||||
postData(data._seed, keys)
|
||||
var key = eth.getKey().privateKey;
|
||||
|
||||
postData(data._seed, key)
|
||||
break
|
||||
case "watch":
|
||||
require(1)
|
||||
@ -99,14 +100,13 @@ ApplicationWindow {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "getSecretToAddress":
|
||||
require(1)
|
||||
postData(data._seed, eth.secretToAddress(data.args[0]))
|
||||
break;
|
||||
case "debug":
|
||||
console.log(data.args[0]);
|
||||
break;
|
||||
case "test":
|
||||
console.log("in")
|
||||
webview.experimental.evaluateJavaScript("hello()")
|
||||
console.log("out")
|
||||
break;
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(data.call + ": " + e)
|
||||
@ -134,7 +134,6 @@ ApplicationWindow {
|
||||
postEvent("object:"+stateObject.address(), stateObject)
|
||||
}
|
||||
function onStorageChangeCb(storageObject) {
|
||||
console.log("storage object cb", storageObject)
|
||||
var ev = ["storage", storageObject.stateAddress, storageObject.address].join(":");
|
||||
postEvent(ev, [storageObject.address, storageObject.value])
|
||||
}
|
||||
|
@ -26,17 +26,19 @@ function createTransaction() {
|
||||
function init() {
|
||||
eth.set({width: 500});
|
||||
|
||||
eth.getKey(function(keyPair) {
|
||||
mAddr = keyPair.privateKey;
|
||||
eth.getKey(function(sec) {
|
||||
eth.getSecretToAddress(sec, function(addr) {
|
||||
mAddr = addr;
|
||||
|
||||
eth.getStorageAt(jefcoinAddr, keyPair.address, function(storage) {
|
||||
eth.getStorageAt(jefcoinAddr, addr, function(storage) {
|
||||
document.querySelector("#current-amount").innerHTML = storage;
|
||||
});
|
||||
|
||||
eth.watch(jefcoinAddr, keyPair.address, function(addr, value) {
|
||||
eth.watch(jefcoinAddr, addr, function(addr, value) {
|
||||
document.querySelector("#current-amount").innerHTML = value
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user