Class: Bitmex::Apikey

Inherits:
Base
  • Object
show all
Defined in:
lib/bitmex/apikey.rb

Overview

Persistent API Keys for Developers

Author:

  • Iulian Costan

Instance Attribute Summary collapse

Attributes inherited from Base

#rest, #websocket

Instance Method Summary collapse

Constructor Details

#initialize(rest, api_key = nil) ⇒ Apikey

Create new Apikey

Parameters:

  • rest (Bitmex::Rest)

    the rest client

  • api_key (String) (defaults to: nil)

    public apikey



10
11
12
13
# File 'lib/bitmex/apikey.rb', line 10

def initialize(rest, api_key = nil)
  super rest
  @api_key = api_key
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



5
6
7
# File 'lib/bitmex/apikey.rb', line 5

def api_key
  @api_key
end

Instance Method Details

#allArray

Get your API Keys

Returns:

  • (Array)

    the api keys



17
18
19
20
21
# File 'lib/bitmex/apikey.rb', line 17

def all
  rest.get apikey_path, auth: true do |response|
    response_handler response
  end
end

#disableObject

NOT SUPPORTED

Returns:

  • 403 Access Denied



33
34
35
36
37
# File 'lib/bitmex/apikey.rb', line 33

def disable
  rest.post apikey_path(:disable) do |response|
    response_handler response
  end
end

#enableObject

NOT SUPPORTED #return 403 Access Denied



25
26
27
28
29
# File 'lib/bitmex/apikey.rb', line 25

def enable
  rest.post apikey_path(:enable) do |response|
    response_handler response
  end
end