Class: Bybit::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/bybit/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = nil, **overrides) ⇒ Client

gen-sdk-ruby:client-readers:end



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/bybit/client.rb', line 41

def initialize(config = nil, **overrides)
  cfg = (config || Bybit.configuration).dup
  overrides.each { |k, v| cfg.public_send("#{k}=", v) }
  session = Session.new(cfg)
  @config = cfg

  # gen-sdk-ruby:client-inits:start
  @account = RestApi::AccountService.new(session)
  @affiliate = RestApi::AffiliateService.new(session)
  @asset = RestApi::AssetService.new(session)
  @bot = RestApi::BotService.new(session)
  @broker = RestApi::BrokerService.new(session)
  @crypto_loan = RestApi::CryptoLoanService.new(session)
  @earn = RestApi::EarnService.new(session)
  @market = RestApi::MarketService.new(session)
  @p2p = RestApi::P2pService.new(session)
  @position = RestApi::PositionService.new(session)
  @rfq = RestApi::RfqService.new(session)
  @spot_margin = RestApi::SpotMarginService.new(session)
  @trade = RestApi::TradeService.new(session)
  @user = RestApi::UserService.new(session)
  # gen-sdk-ruby:client-inits:end
end

Instance Attribute Details

#accountObject (readonly)

gen-sdk-ruby:client-readers:start



36
37
38
# File 'lib/bybit/client.rb', line 36

def 
  @account
end

#affiliateObject (readonly)

gen-sdk-ruby:client-readers:start



36
37
38
# File 'lib/bybit/client.rb', line 36

def affiliate
  @affiliate
end

#assetObject (readonly)

gen-sdk-ruby:client-readers:start



36
37
38
# File 'lib/bybit/client.rb', line 36

def asset
  @asset
end

#botObject (readonly)

gen-sdk-ruby:client-readers:start



36
37
38
# File 'lib/bybit/client.rb', line 36

def bot
  @bot
end

#brokerObject (readonly)

gen-sdk-ruby:client-readers:start



36
37
38
# File 'lib/bybit/client.rb', line 36

def broker
  @broker
end

#crypto_loanObject (readonly)

gen-sdk-ruby:client-readers:start



36
37
38
# File 'lib/bybit/client.rb', line 36

def crypto_loan
  @crypto_loan
end

#earnObject (readonly)

gen-sdk-ruby:client-readers:start



36
37
38
# File 'lib/bybit/client.rb', line 36

def earn
  @earn
end

#marketObject (readonly)

gen-sdk-ruby:client-readers:start



36
37
38
# File 'lib/bybit/client.rb', line 36

def market
  @market
end

#p2pObject (readonly)

gen-sdk-ruby:client-readers:start



36
37
38
# File 'lib/bybit/client.rb', line 36

def p2p
  @p2p
end

#positionObject (readonly)

gen-sdk-ruby:client-readers:start



36
37
38
# File 'lib/bybit/client.rb', line 36

def position
  @position
end

#rfqObject (readonly)

gen-sdk-ruby:client-readers:start



36
37
38
# File 'lib/bybit/client.rb', line 36

def rfq
  @rfq
end

#spot_marginObject (readonly)

gen-sdk-ruby:client-readers:start



36
37
38
# File 'lib/bybit/client.rb', line 36

def spot_margin
  @spot_margin
end

#tradeObject (readonly)

gen-sdk-ruby:client-readers:start



36
37
38
# File 'lib/bybit/client.rb', line 36

def trade
  @trade
end

#userObject (readonly)

gen-sdk-ruby:client-readers:start



36
37
38
# File 'lib/bybit/client.rb', line 36

def user
  @user
end

Instance Method Details

#inspectObject Also known as: to_s

Redacted #inspect so console printing doesn't leak the secret.



66
67
68
# File 'lib/bybit/client.rb', line 66

def inspect
  "#<Bybit::Client testnet=#{@config.testnet} base_url=#{@config.resolved_base_url}>"
end