Blockchain WebSocket API
Receive real-time Bitcoin transaction notifications, new block events, and address monitoring via the Blockchain.com WebSocket API.
Receive real-time Bitcoin transaction notifications, new block events, and address monitoring via the Blockchain.com WebSocket API.
Monitor the Bitcoin blockchain in real time with transaction, block, and address event subscriptions.
The sgcWebSockets Blockchain component connects to the Blockchain.com WebSocket API for real-time Bitcoin network monitoring. Subscribe to unconfirmed transactions, new block notifications, and specific address activity. Build payment monitoring systems, block explorers, and wallet notification services.
Monitor Bitcoin transactions in real time.
uses
sgcHTTP_API_Blockchain;
var
Blockchain: TsgcHTTPAPI_Blockchain;
procedure TForm1.FormCreate(Sender: TObject);
begin
Blockchain := TsgcHTTPAPI_Blockchain.Create(nil);
Blockchain.OnBlockchainTransaction := OnTransaction;
Blockchain.Connect;
end;
procedure TForm1.Subscribe;
begin
// Monitor a specific Bitcoin address
Blockchain.SubscribeAddress(
'1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa');
end;
procedure TForm1.OnTransaction(Sender: TObject;
aHash, aValue: string);
begin
Memo1.Lines.Add('TX: ' + aHash +
' Value: ' + aValue + ' BTC');
end;