Class: CryptomateApi::Mpc::Account

Inherits:
Base
  • Object
show all
Defined in:
lib/cryptomate_api/mpc/account.rb

Overview

The accounts module allows you to create and manage multiple accounts, each with their own wallets. This allows you to manage your crypto assets in a more organized manner, and also allows you to create multiple wallets for the same or different blockchain.

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from CryptomateApi::Base

Instance Method Details

#create_account(alias_name) ⇒ Object

Create an account cryptomate.me/docs/mpc/create-an-account Response:

"id": "String",
"alias": "String",
"wallets": []

Parameters:

  • alias_name (String)

    (Alias name of the account to create.)



38
39
40
# File 'lib/cryptomate_api/mpc/account.rb', line 38

def (alias_name)
  self.class.post('/mpc/accounts/create', body: { alias: alias_name }.to_json)
end

#delete_account(account_id) ⇒ Object

Parameters:

  • account_id (String)

    (Id of the account to delete.)



66
67
68
# File 'lib/cryptomate_api/mpc/account.rb', line 66

def ()
  self.class.delete("/mpc/account/#{}")
end

#edit_account(account_id, alias_name) ⇒ Object

Edit account: Modifies the account information. cryptomate.me/docs/mpc/edit-account Response: {

"id": "string",
"alias": "string",
"wallets": [
  {
    "id": "string",
    "alias": "string",
    "wallet_address": "string",
    "blockchain": "string"
  }
]

}

Parameters:

  • account_id (String)

    (Id of the account to edit.)

  • alias_name (String)

    (New alias name of the account.)



59
60
61
# File 'lib/cryptomate_api/mpc/account.rb', line 59

def (, alias_name)
  self.class.put("/mpc/account/#{}", body: { alias: alias_name }.to_json)
end

#get_all_accountsObject

Get all accounts cryptomate.me/docs/mpc#get-all-accounts TODO: check response if it’s an array or a hash Response: {

"id": "string",
"alias": "string",
"wallets": [
  {
    "id": "string",
    "alias": "string",
    "wallet_address": "string",
    "blockchain": "string"
  }
]

}



25
26
27
# File 'lib/cryptomate_api/mpc/account.rb', line 25

def get_all_accounts
  self.class.get('/mpc/accounts/list')
end