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.

Class Method Summary collapse

Class 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.)



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

def (alias_name)
  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.)



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

def ()
  delete("/mpc/account/#{account_id}")
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.)



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

def (, alias_name)
  put("/mpc/account/#{account_id}", 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"
  }
]

}



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

def get_all_accounts
  get('/mpc/accounts/list')
end