Skip to content

Commit

Permalink
Add expiration method to TransactionBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNaif2018 committed Jan 31, 2023
1 parent cb99772 commit a95681b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tronpy/async_tron.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ def memo(self, memo: Union[str, bytes]) -> "AsyncTransactionBuilder":
self._raw_data["data"] = data.hex()
return self

def expiration(self, expiration: int) -> "AsyncTransactionBuilder":
self._raw_data['expiration'] = current_timestamp() + expiration
return self

def fee_limit(self, value: int) -> "AsyncTransactionBuilder":
"""Set fee_limit of the transaction, in `SUN`."""
self._raw_data["fee_limit"] = value
Expand Down
4 changes: 4 additions & 0 deletions tronpy/tron.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ def memo(self, memo: Union[str, bytes]) -> "TransactionBuilder":
self._raw_data["data"] = data.hex()
return self

def expiration(self, expiration: int) -> "TransactionBuilder":
self._raw_data['expiration'] = current_timestamp() + expiration
return self

def fee_limit(self, value: int) -> "TransactionBuilder":
"""Set fee_limit of the transaction, in `SUN`."""
self._raw_data["fee_limit"] = value
Expand Down

0 comments on commit a95681b

Please sign in to comment.