Skip to content

Instantly share code, notes, and snippets.

@svanas
Last active May 31, 2023 17:34
Show Gist options
  • Save svanas/7ab5ba600406c0b70e2bfc63a733ca58 to your computer and use it in GitHub Desktop.
Save svanas/7ab5ba600406c0b70e2bfc63a733ca58 to your computer and use it in GitHub Desktop.
Transferring Ether with Delphi
web3.eth.tx.sendTransaction(
TWeb3.Create(Ganache), // Ganache 2.7.1
TPrivateKey('24622d680bb9d6d80c4d3fb4b4818e738de64b521948b1b1c85616eeeda54ee1'), // from private key
'0xaDDcedc01C1070bCE0aF7eb853845e7811EB649C', // to public key
web3.eth.utils.toWei('0.01', ether).Value, // 0.01 ether
procedure(tx: TTxHash; err: IError)
begin
TThread.Synchronize(nil, procedure
begin
if Assigned(err) then
MessageDlg(err.Message, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK], 0)
else
MessageDlg(string(tx), TMsgDlgType.mtInformation, [TMsgDlgBtn.mbOK], 0);
end);
end
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment