New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add API endpoint for currencies #1433
Conversation
app/api/api_v2/currencies.rb
Outdated
optional :type, type: String, values: %w[fiat coin], desc: 'Type of currency. Available values: coin, fiat' | ||
end | ||
get '/currencies' do | ||
if params[:type].nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params[:type].blank?
app/api/api_v2/entities/currency.rb
Outdated
|
||
expose :base_factor, documentation: 'Currency base factor' | ||
expose :precision, documentation: 'Currency precision' | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expose only:
id, symbol, type, deposit_fee, withdraw_fee, quick_withdraw_limit, deposit_confirmations, allow_multiple_deposit_addresses, base_factor, precision
spec/api/api_v2/currencies_spec.rb
Outdated
@@ -67,10 +66,67 @@ | |||
|
|||
after { KlineDB.redis.flushall } | |||
|
|||
RSpec::Matchers.define :have_trade_structure do | |||
match { |x| not (x.dig(:price).nil? || x.dig(:volume).nil? || x.dig(:change).nil?) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
match { |x| x[:price].present? && x[:volume].present? && x[:change].present? }
Please update doc https://github.com/rubykube/peatio/blob/master/docs/api/member_api_v2.md |
@ysv Travis CI will do this for us. |
@shal I don't think we run bump in master |
@ysv you won 😄 |
@ysv I updated member API documentation according to this patch. |
@ysv Ready. |
@shal looks good for me |
@ysv Please, push this PR into |
* Add API endpoint for currencies * Prettify code for currency/trades endpoint * Prettify tests for currency/trades endpoint * Finish * Fix spec * Add one more spec of currency structure * Fix typo * Add documentation about added currency API * Fix
No description provided.