From 4a0d8ed1adda9300a954493be4aee8d7e804732d Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Tue, 8 Mar 2022 21:27:58 +0000 Subject: [PATCH] Create a function to get all valid bank details --- handler/markets.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/handler/markets.py b/handler/markets.py index ea305e1..1770634 100644 --- a/handler/markets.py +++ b/handler/markets.py @@ -166,6 +166,19 @@ class Markets(util.Base): if asset == filter_asset: yield (asset, countrycode, currency, provider) + def get_valid_account_details(self): + currencies = self.sinks.currencies + account_info = self.sinks.account_info + all_currencies = self.get_all_currencies() + supported_currencies = [currency for currency in currencies if currency in all_currencies] + currency_account_info_map = {} + for currency in supported_currencies: + for bank, accounts in account_info.items(): + for account in accounts: + if account["currency"] == currency: + currency_account_info_map[currency] = account["account_number"] + return (supported_currencies, currency_account_info_map) + def distribute_account_details(self, currencies=None, account_info=None): """ Distribute account details for ads.