Skip to content

Commit 03eb763

Browse files
committed
fix: pricing only show the pricing of the selected payment_type
1 parent f4676d7 commit 03eb763

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/aleph_client/commands/instance/__init__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ async def create(
213213
)
214214
)
215215
async with AuthenticatedAlephHttpClient(account=account) as client:
216-
vouchers = await client.voucher.fetch_vouchers_by_chain(chain=Chain(account.CHAIN))
216+
vouchers = await client.voucher.fetch_vouchers_by_chain(
217+
address=address, chain=Chain(account.CHAIN)
218+
)
217219
if len(vouchers) == 0:
218220
console.print("No NFT vouchers find on this account")
219221
raise typer.Exit(code=1)
@@ -354,7 +356,9 @@ async def create(
354356
)
355357

356358
if not tier:
357-
pricing.display_table_for(entity=pricing_entity, network_gpu=found_gpu_models, tier=None)
359+
pricing.display_table_for(
360+
entity=pricing_entity, network_gpu=found_gpu_models, tier=None, payment_type=payment_type
361+
)
358362
tiers = list(pricing.data[pricing_entity].tiers)
359363

360364
# GPU entities: filter to tiers that actually use the selected GPUs
@@ -418,7 +422,8 @@ async def create(
418422
compute_unit_price = pricing.data[pricing_entity].price.get("compute_unit")
419423
if payment_type in [PaymentType.hold, PaymentType.superfluid]:
420424
# Early check with minimal cost (Gas + Aleph ERC20)
421-
balance_response = await client.get_balances(address)
425+
async with AlephHttpClient(api_server=settings.API_HOST) as client:
426+
balance_response = await client.get_balances(address)
422427
available_amount = balance_response.balance - balance_response.locked_amount
423428
available_funds = Decimal(0 if is_stream else available_amount)
424429
try:

0 commit comments

Comments
 (0)