44# See License.txt in the project root for license information.
55# --------------------------------------------------------------------
66
7+ """
8+ tronapi.trx
9+ ===============
10+
11+ Work with basic methods
12+
13+ :copyright: © 2018 by the iEXBase.
14+ :license: MIT License
15+ """
16+
717import math
818from typing import Any
919
@@ -321,7 +331,11 @@ def send_transaction(self, to, amount, options=None):
321331 if 'from' not in options :
322332 options = assoc (options , 'from' , self .tron .default_address .hex )
323333
324- tx = self .tron .transaction .send_transaction (to , amount , options ['from' ])
334+ tx = self .tron .transaction_builder .send_transaction (
335+ to ,
336+ amount ,
337+ options ['from' ]
338+ )
325339 # If a comment is attached to the transaction,
326340 # in this case adding to the object
327341 if 'message' in options :
@@ -348,7 +362,12 @@ def send_token(self, to, amount, token_id=None, account=None):
348362 if account is None :
349363 account = self .tron .default_address .hex
350364
351- tx = self .tron .transaction .send_token (to , amount , token_id , account )
365+ tx = self .tron .transaction_builder .send_token (
366+ to ,
367+ amount ,
368+ token_id ,
369+ account
370+ )
352371 sign = self .sign (tx )
353372 result = self .broadcast (sign )
354373
@@ -371,7 +390,12 @@ def freeze_balance(self, amount=0, duration=3, resource='BANDWIDTH', account=Non
371390 if account is None :
372391 account = self .tron .default_address .hex
373392
374- transaction = self .tron .transaction .freeze_balance (amount , duration , resource , account )
393+ transaction = self .tron .transaction_builder .freeze_balance (
394+ amount ,
395+ duration ,
396+ resource ,
397+ account
398+ )
375399 sign = self .sign (transaction )
376400 response = self .broadcast (sign )
377401
@@ -391,7 +415,10 @@ def unfreeze_balance(self, resource='BANDWIDTH', account=None):
391415 if account is None :
392416 account = self .tron .default_address .hex
393417
394- transaction = self .tron .transaction .unfreeze_balance (resource , account )
418+ transaction = self .tron .transaction_builder .unfreeze_balance (
419+ resource ,
420+ account
421+ )
395422 sign = self .sign (transaction )
396423 response = self .broadcast (sign )
397424
@@ -499,7 +526,10 @@ def update_account(self, account_name, address=None):
499526 if address is None :
500527 address = self .tron .default_address .hex
501528
502- transaction = self .tron .transaction .update_account (account_name , address )
529+ transaction = self .tron .transaction_builder .update_account (
530+ account_name ,
531+ address
532+ )
503533 sign = self .sign (transaction )
504534 response = self .broadcast (sign )
505535
@@ -518,7 +548,10 @@ def apply_for_sr(self, url, address):
518548 if address is None :
519549 address = self .tron .default_address .hex
520550
521- transaction = self .tron .transaction .apply_for_sr (url , address )
551+ transaction = self .tron .transaction_builder .apply_for_sr (
552+ url ,
553+ address
554+ )
522555 sign = self .sign (transaction )
523556 response = self .broadcast (sign )
524557
@@ -755,7 +788,11 @@ def vote_proposal(self, proposal_id, has_approval, voter_address):
755788 if voter_address is None :
756789 voter_address = self .tron .default_address .hex
757790
758- transaction = self .tron .transaction .vote_proposal (proposal_id , has_approval , voter_address )
791+ transaction = self .tron .transaction_builder .vote_proposal (
792+ proposal_id ,
793+ has_approval ,
794+ voter_address
795+ )
759796 sign = self .sign (transaction )
760797 response = self .broadcast (sign )
761798
@@ -775,7 +812,10 @@ def proposal_delete(self, proposal_id: int, issuer_address: str):
775812 if issuer_address is None :
776813 issuer_address = self .tron .default_address .hex
777814
778- transaction = self .tron .transaction .delete_proposal (proposal_id , issuer_address )
815+ transaction = self .tron .transaction_builder .delete_proposal (
816+ proposal_id ,
817+ issuer_address
818+ )
779819 sign = self .sign (transaction )
780820 response = self .broadcast (sign )
781821
0 commit comments