Skip to content

Instantly share code, notes, and snippets.

@svanas
Last active May 8, 2023 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svanas/e74ddc085e6282933f041c2928dc7ebd to your computer and use it in GitHub Desktop.
Save svanas/e74ddc085e6282933f041c2928dc7ebd to your computer and use it in GitHub Desktop.
Get balance of Ethereum wallet from Delphi
web3.eth.getBalance(TWeb3.Create(Ganache), Edit1.Text, procedure(qty: BigInteger; err: IError)
begin
TThread.Synchronize(nil, procedure
begin
if Assigned(err) then
MessageDlg(err.Message, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK], 0)
else
ShowMessage(web3.eth.utils.fromWei(qty, web3.eth.utils.ether) + ' ether');
end);
end);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment