diff --git a/pywisetransfer/__init__.py b/pywisetransfer/__init__.py index 8d83961..df00478 100644 --- a/pywisetransfer/__init__.py +++ b/pywisetransfer/__init__.py @@ -7,6 +7,7 @@ def add_resources(self) -> None: from pywisetransfer.balance_statements import BalanceStatements from pywisetransfer.balances import Balances from pywisetransfer.borderless_account import BorderlessAccount + from pywisetransfer.multi_currency_account import MultiCurrencyAccount from pywisetransfer.profile import Profile from pywisetransfer.subscription import Subscription from pywisetransfer.user import User @@ -15,6 +16,7 @@ def add_resources(self) -> None: self.balance_statements = BalanceStatements(client=self) self.balances = Balances(client=self) self.borderless_accounts = BorderlessAccount(client=self) + self.multi_currency_account = MultiCurrencyAccount(client=self) self.profiles = Profile(client=self) self.subscriptions = Subscription(client=self) self.users = User(client=self) diff --git a/pywisetransfer/multi_currency_account.py b/pywisetransfer/multi_currency_account.py new file mode 100644 index 0000000..9d51e6c --- /dev/null +++ b/pywisetransfer/multi_currency_account.py @@ -0,0 +1,25 @@ +from typing import Any + +from apiron import JsonEndpoint +from munch import munchify + +from pywisetransfer import Client +from pywisetransfer.base import Base + + +class MultiCurrencyAccountService(Base): + available_currencies = JsonEndpoint( + path="/v2/borderless-accounts-configuration/profiles/{profile_id}/available-currencies" + ) + get = JsonEndpoint(path="/v4/profiles/{profile_id}/multi-currency-account") + + +class MultiCurrencyAccount: + def __init__(self, client: Client): + self.service = MultiCurrencyAccountService(client=client) + + def available_currencies(self, profile_id: str) -> Any: + return munchify(self.service.available_currencies(profile_id=profile_id)) + + def get(self, profile_id: str) -> Any: + return munchify(self.service.get(profile_id=profile_id))