Skip to content

Commit a40c15f

Browse files
authored
fix: enable vendorfield for htlc lock (#104)
1 parent 44910ba commit a40c15f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

crypto/transactions/builder/htlc_lock.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ class HtlcLock(BaseTransactionBuilder):
66

77
transaction_type = TRANSACTION_HTLC_LOCK
88

9-
def __init__(self, recipient_id, secret_hash, expiration_type, expiration_value, fee=None):
9+
def __init__(self, recipient_id, secret_hash, expiration_type, expiration_value, vendorField=None, fee=None):
1010
"""Create a timelock transaction
1111
1212
Args:
1313
recipient_id (str): recipient identifier
1414
secret_hash (str): a hash of the secret. The SAME hash must be used in the corresponding “claim” transaction
1515
expiration_type (int): type of the expiration. Either block height or network epoch timestamp based
1616
expiration_value (int): Expiration of transaction in seconds or height depending on expiration_type
17+
vendorField (str): value for the vendor field aka smartbridge
1718
fee (int, optional): fee used for the transaction (default is already set)
1819
"""
1920
super().__init__()
@@ -30,6 +31,8 @@ def __init__(self, recipient_id, secret_hash, expiration_type, expiration_value,
3031
}
3132
}
3233

34+
self.transaction.vendorField = vendorField.encode() if vendorField else None
35+
3336
if fee:
3437
self.transaction.fee = fee
3538

0 commit comments

Comments
 (0)