29 lines
1.1 KiB
Ruby
29 lines
1.1 KiB
Ruby
# encoding: UTF-8
|
|
# frozen_string_literal: true
|
|
|
|
module API
|
|
module V2
|
|
module Account
|
|
class Levels < Grape::API
|
|
|
|
desc 'Get current level and next level informations',
|
|
is_array: true
|
|
get '/levels' do
|
|
current_level = current_user.group
|
|
next_level = current_user.next_group
|
|
current_level_min_max = Member.min_max_group(current_level)
|
|
next_level_min_max = Member.min_max_group(next_level)
|
|
|
|
current_level_fee = TradingFee.for(group: current_level, market_id: 'ANY')
|
|
next_level_fee = TradingFee.for(group: next_level, market_id: 'ANY')
|
|
|
|
{ 'current': { 'name': current_level, 'max': current_level_min_max[1], 'min': current_level_min_max[0],
|
|
'maker_fee': current_level_fee.maker, 'taker_fee': current_level_fee.taker },
|
|
'next': { 'name': next_level, 'max': next_level_min_max[1], 'min': next_level_min_max[0],
|
|
'maker_fee': next_level_fee.maker, 'taker_fee': next_level_fee.taker }}
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|