def fetch_balance(self, params={}):
    defaultType = self.safe_string_2(self.options, 'fetchBalance', 'defaultType')
    type = self.safe_string(params, 'type', defaultType)
    if (type is None):
        raise ArgumentsRequired((self.id + " fetchBalance() requires a type parameter(one of 'account', 'spot', 'margin', 'futures', 'swap')"))
    self.load_markets()
    suffix = ('Wallet' if (type == 'account') else 'Accounts')
    method = ((type + 'Get') + suffix)
    query = self.omit(params, 'type')
    response = getattr(self, method)(query)
    return self.parse_balance_by_type(type, response)
def fetch_balance(self, params={}):
    defaultType = self.safe_string_2(self.options, 'fetchBalance', 'defaultType')
    type = self.safe_string(params, 'type', defaultType)
    if (type is None):
        raise ArgumentsRequired((self.id + " fetchBalance() requires a type parameter(one of 'account', 'spot', 'margin', 'futures', 'swap')"))
    self.load_markets()
    suffix = ('Wallet' if (type == 'account') else 'Accounts')
    method = ((type + 'Get') + suffix)
    query = self.omit(params, 'type')
    response = getattr(self, method)(query)
    return self.parse_balance_by_type(type, response)