From 5f8939dd58ce95a1fd188b0b42cfdd62ab3621c6 Mon Sep 17 00:00:00 2001 From: MrNaif2018 Date: Fri, 15 Mar 2024 20:34:41 +0300 Subject: [PATCH] Get_delegated_resource_account_index_v2. Fixes #114 --- tronpy/async_tron.py | 10 ++++++++++ tronpy/tron.py | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/tronpy/async_tron.py b/tronpy/async_tron.py index 4940198..655a33d 100644 --- a/tronpy/async_tron.py +++ b/tronpy/async_tron.py @@ -826,6 +826,16 @@ async def get_delegated_resource_v2(self, fromAddr: TAddress, toAddr: TAddress) }, ) + async def get_delegated_resource_account_index_v2(self, addr: TAddress) -> dict: + """Query the resource delegation index by an account""" + return await self.provider.make_request( + "wallet/getdelegatedresourceaccountindexv2", + { + "value": keys.to_base58check_address(addr), + "visible": True, + }, + ) + # Block query async def get_latest_solid_block(self) -> dict: diff --git a/tronpy/tron.py b/tronpy/tron.py index 71989e6..1603449 100644 --- a/tronpy/tron.py +++ b/tronpy/tron.py @@ -816,6 +816,16 @@ def get_delegated_resource_v2(self, fromAddr: TAddress, toAddr: TAddress) -> dic }, ) + def get_delegated_resource_account_index_v2(self, addr: TAddress) -> dict: + """Query the resource delegation index by an account""" + return self.provider.make_request( + "wallet/getdelegatedresourceaccountindexv2", + { + "value": keys.to_base58check_address(addr), + "visible": True, + }, + ) + # Block query def get_latest_solid_block(self) -> dict: