getBalanceAt getStorageAt, fixed get balance api call

pull/84/head
obscuren 11 years ago
parent 183dbcc6a0
commit c5481b7654
  1. 4
      ethereal/assets/ethereum.js
  2. 2
      ethereal/assets/qml/webapp.qml
  3. 8
      ethereal/assets/samplecoin.html

@ -29,7 +29,7 @@ window.eth = {
postData({call: "create", args: [sec, value, gas, gasPrice, init, body]}, cb);
},
getStorage: function(address, storageAddress, cb) {
getStorageAt: function(address, storageAddress, cb) {
postData({call: "getStorage", args: [address, storageAddress]}, cb);
},
@ -37,7 +37,7 @@ window.eth = {
postData({call: "getKey"}, cb);
},
getBalance: function(address, cb) {
getBalanceAt: function(address, cb) {
postData({call: "getBalance", args: [address]}, cb);
},

@ -76,7 +76,7 @@ ApplicationWindow {
case "getBalance":
require(1);
postData(data._seed, eth.getStateObject(data.args[0]).Value());
postData(data._seed, eth.getStateObject(data.args[0]).value());
break
case "getKey":

@ -23,15 +23,19 @@ function tests() {
function init() {
eth.getKey(function(key) {
eth.getStorage(jefcoinAddr, key, function(storage) {
eth.getStorageAt(jefcoinAddr, key, function(storage) {
document.querySelector("#currentAmount").innerHTML = "Amount: " + storage;
});
eth.watch(jefcoinAddr, function(stateObject) {
eth.getStorage(jefcoinAddr, key, function(storage) {
eth.getStorageAt(jefcoinAddr, key, function(storage) {
document.querySelector("#currentAmount").innerHTML = "Amount: " + storage;
});
});
eth.getBalanceAt(key, function(balance) {
debug("balance", balance);
})
});
}

Loading…
Cancel
Save