Class: Melaya::AccountsAPI
- Inherits:
-
Object
- Object
- Melaya::AccountsAPI
- Defined in:
- lib/melaya/accounts.rb
Overview
Accounts API — GDPR data export, API key management, and profile updates.
Maps to /api/v1/private/accounts/* and /api/v1/private/keys/*.
Note: credit balance endpoints live in BillingAPI to keep billing concerns co-located. Key listing is in AccountAPI (trading plane) for backward compatibility; this module covers the write/management side.
Instance Method Summary collapse
-
#export_data ⇒ Object
POST /api/v1/private/accounts/export GDPR Art 15/20 data export; returns JSON blob of all user data.
-
#initialize(http) ⇒ AccountsAPI
constructor
A new instance of AccountsAPI.
-
#remove_key(key_id) ⇒ Object
DELETE /api/v1/private/keys/:keyId Remove a stored CEX API key.
-
#update_profile(body = {}) ⇒ Object
PATCH /api/v1/private/accounts/profile Update user display name, avatar, or settings.
Constructor Details
#initialize(http) ⇒ AccountsAPI
Returns a new instance of AccountsAPI.
12 13 14 |
# File 'lib/melaya/accounts.rb', line 12 def initialize(http) @http = http end |
Instance Method Details
#export_data ⇒ Object
POST /api/v1/private/accounts/export GDPR Art 15/20 data export; returns JSON blob of all user data.
18 19 20 |
# File 'lib/melaya/accounts.rb', line 18 def export_data @http.post("/api/v1/private/accounts/export") end |
#remove_key(key_id) ⇒ Object
DELETE /api/v1/private/keys/:keyId Remove a stored CEX API key.
25 26 27 |
# File 'lib/melaya/accounts.rb', line 25 def remove_key(key_id) @http.delete("/api/v1/private/keys/#{enc(key_id)}") end |
#update_profile(body = {}) ⇒ Object
PATCH /api/v1/private/accounts/profile Update user display name, avatar, or settings.
32 33 34 |
# File 'lib/melaya/accounts.rb', line 32 def update_profile(body = {}) @http.patch("/api/v1/private/accounts/profile", body) end |