Create a function to get all valid bank details

This commit is contained in:
Mark Veidemanis 2022-03-08 21:27:58 +00:00
parent 5ed07abc07
commit 4a0d8ed1ad
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 13 additions and 0 deletions

View File

@ -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.