Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ dependencies = [
"aiodns==3.2",
"aiohttp==3.11.13",
"aleph-message>=1.0.1",
"aleph-sdk-python>=2.0.5",
"base58==2.1.1", # Needed now as default with _load_account changement
"aleph-sdk-python @ git+https://github.com/aleph-im/aleph-sdk-python@1yam-voucher-service",
"base58==2.1.1", # Needed now as default with _load_account changement
"click<8.2",
"py-sr25519-bindings==0.2", # Needed for DOT signatures
"py-sr25519-bindings==0.2", # Needed for DOT signatures
"pydantic>=2",
"pygments==2.19.1",
"pynacl==1.5", # Needed now as default with _load_account changement
"pynacl==1.5", # Needed now as default with _load_account changement
"python-magic==0.4.27",
"rich==13.9.*",
"setuptools>=65.5",
"substrate-interface==1.7.11", # Needed for DOT signatures
"substrate-interface==1.7.11", # Needed for DOT signatures
"textual==0.73",
"typer==0.15.2",
]
Expand Down
12 changes: 5 additions & 7 deletions src/aleph_client/commands/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import aiohttp
import typer
from aleph.sdk import AuthenticatedAlephHttpClient
from aleph.sdk.account import _load_account
from aleph.sdk.chains.common import generate_key
from aleph.sdk.chains.solana import parse_private_key as parse_solana_private_key
Expand Down Expand Up @@ -42,7 +43,6 @@
yes_no_input,
)
from aleph_client.utils import AsyncTyper, list_unlinked_keys
from aleph_client.voucher import VoucherManager

logger = logging.getLogger(__name__)
app = AsyncTyper(no_args_is_help=True)
Expand Down Expand Up @@ -301,8 +301,6 @@ async def balance(
if account and not address:
address = account.get_address()

voucher_manager = VoucherManager(account=account, chain=chain)

if address:
try:
balance_data = await get_balance(address)
Expand Down Expand Up @@ -335,7 +333,8 @@ async def balance(
]

# Get vouchers and add them to Account Info panel
vouchers = await voucher_manager.get_all(address=address)
async with AuthenticatedAlephHttpClient(account=account) as client:
vouchers = await client.voucher.get_vouchers(address=address)
if vouchers:
voucher_names = [voucher.name for voucher in vouchers]
infos += [
Expand Down Expand Up @@ -422,11 +421,10 @@ async def vouchers(
if account and not address:
address = account.get_address()

voucher_manager = VoucherManager(account=account, chain=chain)

if address:
try:
vouchers = await voucher_manager.get_all(address=address)
async with AuthenticatedAlephHttpClient(account=account) as client:
vouchers = await client.voucher.get_vouchers(address=address)
if vouchers:
voucher_table = Table(title="", show_header=True, box=box.ROUNDED)
voucher_table.add_column("Name", style="bright_cyan")
Expand Down
13 changes: 5 additions & 8 deletions src/aleph_client/commands/instance/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
yes_no_input,
)
from aleph_client.utils import AsyncTyper, sanitize_url
from aleph_client.voucher import VoucherManager

logger = logging.getLogger(__name__)
app = AsyncTyper(no_args_is_help=True)
Expand Down Expand Up @@ -193,9 +192,7 @@ async def create(
# Force-switches if NFT payment-type
nft_chains = [Chain.AVAX, Chain.BASE, Chain.SOL]
if payment_type == "nft":
voucher_manager = VoucherManager(account=account, chain=Chain(account.CHAIN))
payment_type = PaymentType.hold

if payment_chain is None or payment_chain not in nft_chains:
if payment_chain:
console.print(
Expand All @@ -210,11 +207,11 @@ async def create(
default=Chain.AVAX.value,
)
)

vouchers = await voucher_manager.fetch_vouchers_by_chain(payment_chain)
if len(vouchers) == 0:
console.print("No NFT vouchers find on this account")
raise typer.Exit(code=1)
async with AuthenticatedAlephHttpClient(account=account) as client:
vouchers = await client.voucher.fetch_vouchers_by_chain(chain=Chain(account.CHAIN))
if len(vouchers) == 0:
console.print("No NFT vouchers find on this account")
raise typer.Exit(code=1)

elif payment_type in [ptype.value for ptype in PaymentType]:
payment_type = PaymentType(payment_type)
Expand Down
9 changes: 7 additions & 2 deletions src/aleph_client/commands/instance/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,15 @@ def _prepare_allocation_column(self):
color_allocation = "magenta3"
crn_hash = safe_getattr(self.message.content.requirements, "node.node_hash") or ""
else:
crn_url = self.allocation.allocations.node.url
allocation_node = (
self.allocation.allocations.node
if self.allocation.allocations and self.allocation.allocations.node
else None
)
crn_url = allocation_node.url if allocation_node else ""
allocation_str = ALLOCATION_AUTO
color_allocation = "deep_sky_blue1"
crn_hash = self.allocation.allocations.node.node_id
crn_hash = allocation_node.node_id if allocation_node else ""

# Assemble the complete allocation column
self.allocation_column = cast(
Expand Down
213 changes: 0 additions & 213 deletions src/aleph_client/voucher.py

This file was deleted.

Loading
Loading