Skip to content

Commit d605193

Browse files
committed
change 'getTransaction' to return transaction deseralized
1 parent e680a0f commit d605193

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/ElectrumPHP.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,8 @@ public function getTransaction($txid){
317317
'txid' => $txid,
318318
'wallet' => $this->wallet
319319
];
320-
return $this->call("gettransaction", $params);
320+
$raw = $this->call("gettransaction", $params);
321+
return $this->deserialize($raw);
321322

322323
}
323324

@@ -555,7 +556,16 @@ public function getInfosBeforeTransaction($outputs, $checkBalance){
555556
];
556557

557558
}
558-
559+
560+
private function deserialize($raw){
561+
562+
$params = [
563+
'tx' => $raw
564+
];
565+
return $this->call("deserialize", $params);
566+
567+
}
568+
559569
private function detectAddressType($address){
560570

561571
if(strpos($address, '1') === 0){

0 commit comments

Comments
 (0)