import { Injectable } from "@angular/core" ; import { Delegate , Network } from "ark-ts/model" ; import { Observable , Subject } from "rxjs" ; import { Profile , StoredNetwork , Wallet , WalletKeys } from "@/models/model" ; @ Injectable ( ) export abstract class UserDataService { public currentNetwork : StoredNetwork ; public currentWallet : Wallet ; public currentProfile : Profile ; public profiles : Record < string , Profile > ; public networks : Record < string , StoredNetwork > ; public onActivateNetwork$ : Subject < StoredNetwork > ; public onUpdateNetwork$ : Subject < StoredNetwork > ; public onCreateWallet$ : Subject < Wallet > ; public onUpdateWallet$ : Subject < Wallet > ; public onSelectProfile$ : Subject < Profile > ; public abstract get isDevNet ( ) : boolean ; public abstract get isMainNet ( ) : boolean ; public abstract get defaultNetworks ( ) : Network [ ] ; public abstract addOrUpdateNetwork ( network , networkId ? ) ; public abstract getNetworkById ( networkId ) ; public abstract removeNetworkById ( networkId ) ; public abstract addProfile ( profile ) ; public abstract getProfileByName ( name ) ; public abstract getProfileById ( profileId ) ; public abstract removeProfileById ( profileId ) ; public abstract saveProfiles ( profiles ? ) ; public abstract encryptSecondPassphrase ( wallet , pinCode , secondPassphrase , profileId ? ) ; public abstract addWallet ( wallet , passphrase , pinCode , profileId ? ) ; public abstract updateWalletEncryption ( oldPassword , newPassword ) ; public abstract removeWalletByAddress ( address , profileId ? ) ; public abstract ensureWalletDelegateProperties ( wallet , delegateOrUserName ) ; public abstract getWalletByAddress ( address , profileId ? ) ; public abstract updateWallet ( wallet , profileId , notificate ? ) ; public abstract saveWallet ( wallet , profileId ? , notificate ? ) ; public abstract setWalletLabel ( wallet , label ) ; public abstract getWalletLabel ( walletOrAddress , profileId ? ) ; public abstract setCurrentWallet ( wallet ) ; public abstract clearCurrentWallet ( ) ; public abstract loadProfiles ( ) ; public abstract loadNetworks ( ) ; public abstract getKeysByWallet ( wallet , password ) ; }