Skip to content

Commit

Permalink
Get_delegated_resource_account_index_v2. Fixes #114
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNaif2018 committed Mar 15, 2024
1 parent d02ab54 commit 5f8939d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tronpy/async_tron.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 10 additions & 0 deletions tronpy/tron.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5f8939d

Please sign in to comment.