public static async Task <IEnumerable <IPrivateWallet> > GetAllPrivateWallets(this IPrivateWalletsRepository repo, string clientId, IWalletCredentials walletCreds, string defaultWalletName) { var wallets = (await repo.GetStoredWallets(clientId)).ToList(); IPrivateWallet defaultWallet = new PrivateWallet { ClientId = walletCreds.ClientId, WalletAddress = walletCreds.Address, WalletName = defaultWalletName }; wallets.Add(defaultWallet); return(wallets); }
public static async Task <IPrivateWallet> GetPrivateWallet(this IPrivateWalletsRepository repo, string address, IWalletCredentials walletCreds, string defaultWalletName) { var wallet = await repo.GetStoredWallet(address); if (wallet == null && walletCreds.Address == address) { wallet = new PrivateWallet { ClientId = walletCreds.ClientId, WalletAddress = walletCreds.Address, WalletName = defaultWalletName }; } return(wallet); }