Use new call helper for all OANDA commands

This commit is contained in:
2022-11-04 07:20:12 +00:00
parent c773b93675
commit 0c52cbd0f8
2 changed files with 9 additions and 12 deletions

View File

@@ -18,8 +18,7 @@ class OANDAExchange(BaseExchange):
def get_account(self):
r = accounts.AccountDetails(self.account_id)
self.client.request(r)
return r.response
return self.call(r)
def get_supported_assets(self):
return False
@@ -38,8 +37,7 @@ class OANDAExchange(BaseExchange):
def get_trade(self, trade_id):
r = accounts.TradeDetails(accountID=self.account_id, tradeID=trade_id)
self.client.request(r)
return r.response
return self.call(r)
def update_trade(self, trade):
raise NotImplementedError
@@ -54,8 +52,7 @@ class OANDAExchange(BaseExchange):
def get_position_info(self, symbol):
r = positions.PositionDetails(self.account_id, symbol)
self.client.request(r)
return r.response
return self.call(r)
def get_all_positions(self):
items = []