Skip to content

Commit 5ee5209

Browse files
committed
Added method to return the number of confirmations of a TXID
1 parent 6eb1620 commit 5ee5209

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/ElectrumPHP.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,20 @@ public function getTransaction($txid){
322322

323323
}
324324

325+
/*
326+
* $txid: Your TXID;
327+
*/
328+
public function getConfirmations($txid){
329+
330+
$params = [
331+
'txid' => $txid,
332+
'wallet' => $this->wallet
333+
];
334+
$tr = $this->call("get_tx_status", $params);
335+
return ($tr['confirmations'] ?? false);
336+
337+
}
338+
325339
public function checkSyncronization(){
326340

327341
$params = [

0 commit comments

Comments
 (0)