mwerner / bittrex

Unofficial gem for the Bittrex API
MIT License
53 stars 85 forks source link

Set config on a per client basis #27

Open andyklimczak opened 6 years ago

andyklimczak commented 6 years ago

Currently the api key and api secret is set at a Gem level config using:

Bittrex.config do |c|
  c.key = 'my_api_key'
  c.secret = 'my_api_secret'
end

I have a use case for calling the api using different api keys in the same program, and would like to set it at a client level. So something like:

client_1 = Bittrex::Client.new(key: 'key_1', secret: 'secret_1')
wallet_1 = client_1.wallet
client_2 = Bittrex::Client.new(key: 'key_2', secret: 'secret_2')
wallet_2 = client_2.wallet
# do something with wallet_1 and wallet_2

I don't think this gem currently supports this (otherwise please point me in the right direction). I think it would be really helpful. Thank you!

mwerner commented 6 years ago

Hi @andyklimczak, correct I don't think it will work at instantiation like that right now. I'll add the request, thanks.