Class: Melaya::AccountAPI

Inherits:
Object
  • Object
show all
Defined in:
lib/melaya/account.rb

Overview

Account API — authenticated reads about your Melaya account.

Connected-exchange key references (masked), tier limits, and live usage counters. Requires an mk_ key on the private plane.

Instance Method Summary collapse

Constructor Details

#initialize(http) ⇒ AccountAPI

Returns a new instance of AccountAPI.



9
10
11
# File 'lib/melaya/account.rb', line 9

def initialize(http)
  @http = http
end

Instance Method Details

#api_key_statusObject

Status of your platform API key (tier, max concurrent connections).



26
27
28
# File 'lib/melaya/account.rb', line 26

def api_key_status
  @http.get("/api/v1/private/api-key")
end

#keysObject

The exchange API keys connected to your account. api_key is masked (display-only); use api_key_id (e.g. BINANCEUSDM_0) when launching strategies or minting a private stream ticket.



16
17
18
# File 'lib/melaya/account.rb', line 16

def keys
  @http.get("/api/v1/private/keys")["keys"]
end

#usageObject

Tier, plan limits, and live usage counters (mirrors the dashboard’s usage page).



21
22
23
# File 'lib/melaya/account.rb', line 21

def usage
  @http.get("/api/v1/private/usage")
end