Skip to content

Commit 912f422

Browse files
committed
added new methods
1 parent 5fb31f2 commit 912f422

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

tronapi/trx.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,4 +914,30 @@ def list_exchanges_paginated(self, limit=10, offset=0):
914914

915915
def get_node_info(self):
916916
"""Get info about thre node"""
917-
return self.tron.manager.request('wallet/getnodeinfo', {})
917+
return self.tron.manager.request('/wallet/getnodeinfo', {})
918+
919+
def get_token_list_name(self, token_id: str) -> any:
920+
"""Query token list by name.
921+
922+
Args:
923+
token_id (str): The name of the token
924+
"""
925+
if not is_string(token_id):
926+
raise ValueError('Invalid token ID provided')
927+
928+
return self.tron.manager.request('/wallet/getassetissuelistbyname', {
929+
'value': self.tron.toHex(text=token_id)
930+
})
931+
932+
def get_token_by_id(self, token_id: str) -> any:
933+
"""Query token by id.
934+
935+
Args:
936+
token_id (str): The id of the token, it's a string
937+
"""
938+
if not is_string(token_id):
939+
raise ValueError('Invalid token ID provided')
940+
941+
return self.tron.manager.request('/wallet/getassetissuebyid', {
942+
'value': self.tron.toHex(text=token_id)
943+
})

0 commit comments

Comments
 (0)