Class: CryptomateApi::Mpc::Account
- 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
-
#create_account(alias_name) ⇒ Object
Create an account cryptomate.me/docs/mpc/create-an-account Response: { “id”: “String”, “alias”: “String”, “wallets”: [] }.
-
#delete_account(account_id) ⇒ Object
Delete account cryptomate.me/docs/mpc/delete-account.
-
#edit_account(account_id, alias_name) ⇒ Object
Edit account: Modifies the account information.
-
#get_all_accounts ⇒ Object
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” } ] }.
Methods inherited from Base
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": []
38 39 40 |
# File 'lib/cryptomate_api/mpc/account.rb', line 38 def create_account(alias_name) self.class.post('/mpc/accounts/create', body: { alias: alias_name }.to_json) end |
#delete_account(account_id) ⇒ Object
Delete account cryptomate.me/docs/mpc/delete-account
66 67 68 |
# File 'lib/cryptomate_api/mpc/account.rb', line 66 def delete_account(account_id) self.class.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"
}
]
}
59 60 61 |
# File 'lib/cryptomate_api/mpc/account.rb', line 59 def edit_account(account_id, alias_name) self.class.put("/mpc/account/#{account_id}", body: { alias: alias_name }.to_json) end |
#get_all_accounts ⇒ Object
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 |