Great job with the library - just having fun and tinkering around and wanted to ask a question about the return value EthereumQuantity
If I make a request for a balance like so:
private func getMyEthereumBalance() {
do {
let myAddress = try EthereumAddress(hex: "some_hex", eip55: false)
firstly {
web3.eth.getBalance(address: myAddress, block: .latest)
}.done { eth in
print(eth.quantity)
}.catch { error in
print("Error")
}
} catch {
print(error.localizedDescription)
}
}
the eth.quantity comes back as a BigUInt... Question is: what in the world does this int represent lol? I am assuming it's an integer based representation of the value at that address but how would one go about converting it to like the amount of ether as a fraction? like 1.233 instead of the large integer?
Hey guys,
Great job with the library - just having fun and tinkering around and wanted to ask a question about the return value EthereumQuantity
If I make a request for a balance like so:
the
eth.quantity
comes back as a BigUInt... Question is: what in the world does this int represent lol? I am assuming it's an integer based representation of the value at that address but how would one go about converting it to like the amount of ether as a fraction? like 1.233 instead of the large integer?