|
9 | 9 |
|
10 | 10 | import aiohttp |
11 | 11 | import typer |
| 12 | +from aleph.sdk import AuthenticatedAlephHttpClient |
12 | 13 | from aleph.sdk.account import _load_account |
13 | 14 | from aleph.sdk.chains.common import generate_key |
14 | 15 | from aleph.sdk.chains.solana import parse_private_key as parse_solana_private_key |
|
42 | 43 | yes_no_input, |
43 | 44 | ) |
44 | 45 | from aleph_client.utils import AsyncTyper, list_unlinked_keys |
45 | | -from aleph_client.voucher import VoucherManager |
46 | 46 |
|
47 | 47 | logger = logging.getLogger(__name__) |
48 | 48 | app = AsyncTyper(no_args_is_help=True) |
@@ -301,8 +301,6 @@ async def balance( |
301 | 301 | if account and not address: |
302 | 302 | address = account.get_address() |
303 | 303 |
|
304 | | - voucher_manager = VoucherManager(account=account, chain=chain) |
305 | | - |
306 | 304 | if address: |
307 | 305 | try: |
308 | 306 | balance_data = await get_balance(address) |
@@ -335,7 +333,8 @@ async def balance( |
335 | 333 | ] |
336 | 334 |
|
337 | 335 | # Get vouchers and add them to Account Info panel |
338 | | - vouchers = await voucher_manager.get_all(address=address) |
| 336 | + async with AuthenticatedAlephHttpClient(account=account) as client: |
| 337 | + vouchers = await client.voucher.get_vouchers(address=address) |
339 | 338 | if vouchers: |
340 | 339 | voucher_names = [voucher.name for voucher in vouchers] |
341 | 340 | infos += [ |
@@ -422,11 +421,10 @@ async def vouchers( |
422 | 421 | if account and not address: |
423 | 422 | address = account.get_address() |
424 | 423 |
|
425 | | - voucher_manager = VoucherManager(account=account, chain=chain) |
426 | | - |
427 | 424 | if address: |
428 | 425 | try: |
429 | | - vouchers = await voucher_manager.get_all(address=address) |
| 426 | + async with AuthenticatedAlephHttpClient(account=account) as client: |
| 427 | + vouchers = await client.voucher.get_vouchers(address=address) |
430 | 428 | if vouchers: |
431 | 429 | voucher_table = Table(title="", show_header=True, box=box.ROUNDED) |
432 | 430 | voucher_table.add_column("Name", style="bright_cyan") |
|
0 commit comments