Skip to content
Snippets Groups Projects
Commit 39a5e162 authored by Jakub Ziebinski's avatar Jakub Ziebinski
Browse files

Create input for HP and VESTS with dedicated selector

parent 69c0209c
No related branches found
No related tags found
2 merge requests!326V1.27.5.8 release,!306Implement Power down of the HP managament
from __future__ import annotations
from clive.__private.ui.widgets.currency_selector.currency_selector_base import CurrencySelectorBase
from clive.models import Asset
from clive.models.asset import AssetFactoryHolder
class CurrencySelectorHpVests(CurrencySelectorBase[Asset.Hive | Asset.Vests]):
@staticmethod
def _create_selectable() -> dict[str, AssetFactoryHolder[Asset.Hive | Asset.Vests]]:
return {
"HP": AssetFactoryHolder(asset_cls=Asset.Hive, asset_factory=Asset.hive),
"VESTS": AssetFactoryHolder(asset_cls=Asset.Vests, asset_factory=Asset.vests),
}
from __future__ import annotations
from typing import TYPE_CHECKING
from clive.__private.ui.widgets.currency_selector.currency_selector_hp_vests import CurrencySelectorHpVests
from clive.__private.ui.widgets.inputs.asset_amount_base_input import AssetAmountInput
from clive.models import Asset
if TYPE_CHECKING:
from clive.__private.ui.widgets.currency_selector.currency_selector_base import CurrencySelectorBase
class HPVestsAmountInput(AssetAmountInput[Asset.VotingT]):
"""An input for HP/VESTS amount."""
def create_currency_selector(self) -> CurrencySelectorBase[Asset.VotingT]:
return CurrencySelectorHpVests()
......@@ -50,6 +50,7 @@ class Asset:
Hbd: TypeAlias = AssetHbdHF26
Vests: TypeAlias = AssetVestsHF26
LiquidT: TypeAlias = Hive | Hbd
VotingT: TypeAlias = Hive | Vests
AnyT: TypeAlias = Hive | Hbd | Vests
@classmethod
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment