@@ -27,18 +27,15 @@ class Trx(Module):
2727 defaultContractFactory = Contract
2828
2929 def get_current_block (self ):
30- """Query the latest block
31-
32- Returns:
33- Latest block on full node
34- """
30+ """Query the latest block"""
3531 return self .tron .manager .request (url = '/wallet/getnowblock' )
3632
3733 def get_block (self , block : Any = None ):
3834 """Get block details using HashString or blockNumber
3935
4036 Args:
41- block (Any): Number or Hash Block
37+ block (Any): ID or height for the block
38+
4239 """
4340
4441 # If the block identifier is not specified,
@@ -307,10 +304,11 @@ def send_trx(self, to, amount, options=None):
307304
308305 def send_transaction (self , to , amount , options = None ):
309306 """Send an asset to another account.
307+ Will create and broadcast the transaction if a private key is provided.
310308
311- Parameters :
312- to (str): Recipient
313- amount (float): Amount to transfer
309+ Args :
310+ to (str): Address to send TRX to.
311+ amount (float): Amount of TRX to send.
314312 options (Any, optional): Options
315313
316314 """
@@ -322,7 +320,6 @@ def send_transaction(self, to, amount, options=None):
322320 options = assoc (options , 'from' , self .tron .default_address .hex )
323321
324322 tx = self .tron .transaction .send_transaction (to , amount , options ['from' ])
325-
326323 # If a comment is attached to the transaction,
327324 # in this case adding to the object
328325 if 'message' in options :
@@ -402,6 +399,10 @@ def sign(self, transaction: Any, use_tron: bool = True):
402399 """Sign the transaction, the api has the risk of leaking the private key,
403400 please make sure to call the api in a secure environment
404401
402+ Warnings:
403+ Do not use this in any web / user-facing applications.
404+ This will expose the private key.
405+
405406 Args:
406407 transaction (Any): transaction details
407408 use_tron (bool): is Tron header
@@ -440,9 +441,6 @@ def broadcast(self, signed_transaction):
440441 Args:
441442 signed_transaction (object): signed transaction contract data
442443
443- Returns:
444- broadcast success or failure
445-
446444 """
447445 if not is_object (signed_transaction ):
448446 raise InvalidTronError ('Invalid transaction provided' )
0 commit comments