Skip to content

Commit 8b88589

Browse files
author
David Case
committed
fix: add Hex method to transaction
1 parent e3fc117 commit 8b88589

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

transaction/transaction.go

+4
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,10 @@ func (tx *Transaction) Bytes() []byte {
288288
return tx.toBytesHelper(0, nil, false)
289289
}
290290

291+
func (tx *Transaction) Hex() string {
292+
return hex.EncodeToString(tx.Bytes())
293+
}
294+
291295
// EF outputs the transaction into a byte array in extended format
292296
// (with PreviousTxSatoshis and SourceTxScript included)
293297
func (tx *Transaction) EF() ([]byte, error) {

0 commit comments

Comments
 (0)