use serde::{Deserialize, Serialize}; use strum::Display; use subxt::utils::H256; use subxt::config::substrate::DigestItem; use crate::types::{ ActionLevel, ActionTarget, CasperExtrinsicDetails, EraInfo, EraRewardPoints, Nominator, PeerInformation, SessionKeyInfo, SystemAccount, }; #[derive(Debug, Clone, PartialEq, Eq, Display, Serialize, Deserialize)] pub enum Action { Tick, Render, Resize(u16, u16), Suspend, Resume, Quit, ClearScreen, Error(String), Help, CheckPendingTransactions, SetMode(crate::app::Mode), SetActiveScreen(crate::app::Mode), UsedExplorerBlock(Option), UsedExplorerLog(Option), UsedAccount([u8; 32], String), NewAccount(String), NewAddressBookRecord(String, String), SetSender(String, Option), RemoveEraToWatch(u32), ClosePopup, RotateSessionKeys, PayoutValidatorPopup(u32, bool), BalanceRequest([u8; 32], bool), BalanceResponse([u8; 32], Option), BalanceSetActive(Option), RenameAccount(String), RenameAddressBookRecord(String), RenameKnownValidatorRecord, UpdateAccountName(String), UpdateAddressBookRecord(String), UpdateKnownValidator(String), TransferTo(String), AccountDetailsOf(String, Option), StoreRotatedKeys(String), TransferBalance(String, [u8; 32], u128), BondValidatorExtraFrom([u8; 32], u128), BondValidatorFrom([u8; 32], u128), PayoutStakers([u8; 32], [u8; 32], u32), SetSessionKeys([u8; 32], String), ValidateFrom([u8; 32], u32), ChillFrom([u8; 32]), UnbondFrom([u8; 32], u128), RebondFrom([u8; 32], u128), WithdrawUnbondedFrom([u8; 32], u32), EventLog(String, ActionLevel, ActionTarget), NewBestBlock(u32), NewBestHash(H256), NewFinalizedBlock(u32), NewFinalizedHash(H256), BestBlockUpdated(u32), ExtrinsicsLength(u32, usize), ValidatorsNumber(u32), NominatorsNumber(u32), Inflation(String), Apy(String), GetBlockAuthor(H256, Vec), SetBlockAuthor(H256, String), GetNodeName, GetSystemHealth, GetGenesisHash, GetChainName, GetChainVersion, GetPendingExtrinsics, GetConnectedPeers, GetSessionKeys([u8; 32], bool), GetQueuedSessionKeys([u8; 32], bool), GetListenAddresses, GetLocalIdentity, GetLatestBlock, GetFinalizedBlock, GetActiveEra, GetCurrentEra, GetEpochProgress, GetValidatorsNumber, GetNominatorsNumber, GetInflation, GetNominatorsByValidator([u8; 32], bool), GetValidatorAllRewards([u8; 32], bool), GetValidatorLedger([u8; 32], bool), GetIsStashBonded([u8; 32], bool), GetErasStakersOverview([u8; 32], bool), GetValidatorPrefs([u8; 32], bool), GetSlashingSpans([u8; 32], bool), GetValidatorLatestClaim([u8; 32], bool), GetValidatorIsDisabled([u8; 32], bool), GetValidatorInSession([u8; 32], bool), GetCurrentValidatorEraRewards, SetNodeName(Option), SetSystemHealth(Option, bool, bool), SetGenesisHash(Option), SetChainName(Option), SetChainVersion(Option), SetStashAccount([u8; 32]), SetStashSecret([u8; 32]), SetChoosenValidator([u8; 32], u32, u32), SetSlashingSpansLength(usize, [u8; 32]), SetUnlockingIsEmpty(bool, [u8; 32]), BestBlockInformation(H256, u32), FinalizedBlockInformation(H256, u32), ExtrinsicsForBlock(u32, Vec), SetActiveEra(EraInfo), SetCurrentEra(u32), SetEpochProgress(u64, u64), SetPendingExtrinsicsLength(usize), SetConnectedPeers(Vec), SetSessionKey(String, SessionKeyInfo), SetListenAddresses(Vec), SetLocalIdentity(String), SetNominatorsByValidator(Vec, [u8; 32]), SetValidatorEraReward(u32, u128), SetValidatorEraClaimed(u32, bool), SetValidatorEraSlash(u32, u128), SetValidatorEraUnlocking(u32, u128, [u8; 32]), SetValidatorLatestClaim(u32, [u8; 32]), SetValidatorInSession(bool, [u8; 32]), SetIsBonded(bool, [u8; 32]), SetStakedAmountRatio(Option, Option, [u8; 32]), SetStakedRatio(u128, u128, [u8; 32]), SetValidatorPrefs(Option, bool, [u8; 32]), SetCurrentValidatorEraRewards(u32, u32, Vec), GetTotalIssuance, GetExistentialDeposit, GetMinValidatorBond, SetExistentialDeposit(u128), SetMinValidatorBond(u128), SetTotalIssuance(Option), }