From 5ee520927cd550cb224e35b3e55ad9d2c9b4813a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20K=C3=A1ssio?= Date: Wed, 23 Oct 2024 16:33:22 -0300 Subject: [PATCH] Added method to return the number of confirmations of a TXID --- src/ElectrumPHP.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ElectrumPHP.php b/src/ElectrumPHP.php index 43038f8..8bae9ab 100644 --- a/src/ElectrumPHP.php +++ b/src/ElectrumPHP.php @@ -322,6 +322,20 @@ public function getTransaction($txid){ } + /* + * $txid: Your TXID; + */ + public function getConfirmations($txid){ + + $params = [ + 'txid' => $txid, + 'wallet' => $this->wallet + ]; + $tr = $this->call("get_tx_status", $params); + return ($tr['confirmations'] ?? false); + + } + public function checkSyncronization(){ $params = [