Class: CryptomateApi::Management::Credential
- Defined in:
- lib/cryptomate_api/management/credential.rb
Overview
Manage the access you give to each key and the permissions you will have for each blockchain, such as only receiving transactions or only accessing one of the blockchains.
Class Method Summary collapse
-
.create_credential(api_key, operation_id) ⇒ Object
Creates a credential for a API-Key and operation.
-
.delete_credential(credential_id) ⇒ Object
Deletes a credential by ID.
-
.get_all_credentials(api_key) ⇒ Object
Get all credentials for an API-Key cryptomate.me/docs/management#get-all-credentials-for-a-api-key TODO: check response if it’s an array or a hash Response: { “id”: “string”, “key”: { “api_key”: “string”, “name”: “string” }, “operation”: { “id”: “string”, “description”: “string” } }.
-
.get_credential(credential_id) ⇒ Object
Get a credential information by id cryptomate.me/docs/management#get-a-credential-information Response: { “id”: “string”, “key”: { “api_key”: “string”, “name”: “string” }, “operation”: { “id”: “string”, “description”: “string” } }.
-
.update_credential(credential_id, api_key, operation_id) ⇒ Object
Modifies a credential by ID.
Class Method Details
.create_credential(api_key, operation_id) ⇒ Object
Creates a credential for a API-Key and operation. cryptomate.me/docs/management#create-a-credential Response: {
"id": "string",
"key": {
"api_key": "string",
"name": "string"
},
"operation": {
"id": "string",
"description": "string"
}
}
64 65 66 |
# File 'lib/cryptomate_api/management/credential.rb', line 64 def create_credential(api_key, operation_id) post('/management/credentials', body: { api_key:, operation_id: }.to_json) end |
.delete_credential(credential_id) ⇒ Object
Deletes a credential by ID. cryptomate.me/docs/management#delete-a-credential
92 93 94 |
# File 'lib/cryptomate_api/management/credential.rb', line 92 def delete_credential(credential_id) delete("/management/credentials/#{credential_id}") end |
.get_all_credentials(api_key) ⇒ Object
Get all credentials for an API-Key cryptomate.me/docs/management#get-all-credentials-for-a-api-key TODO: check response if it’s an array or a hash Response: {
"id": "string",
"key": {
"api_key": "string",
"name": "string"
},
"operation": {
"id": "string",
"description": "string"
}
}
25 26 27 |
# File 'lib/cryptomate_api/management/credential.rb', line 25 def get_all_credentials(api_key) get("/management/credentials/api-key/#{api_key}") end |
.get_credential(credential_id) ⇒ Object
Get a credential information by id cryptomate.me/docs/management#get-a-credential-information Response: {
"id": "string",
"key": {
"api_key": "string",
"name": "string"
},
"operation": {
"id": "string",
"description": "string"
}
}
44 45 46 |
# File 'lib/cryptomate_api/management/credential.rb', line 44 def get_credential(credential_id) get("/management/credentials/#{credential_id}") end |
.update_credential(credential_id, api_key, operation_id) ⇒ Object
Modifies a credential by ID. cryptomate.me/docs/management#update-a-credential Response: {
"id": "string",
"key": {
"api_key": "string",
"name": "string"
},
"operation": {
"id": "string",
"description": "string"
}
}
85 86 87 |
# File 'lib/cryptomate_api/management/credential.rb', line 85 def update_credential(credential_id, api_key, operation_id) put("/management/credentials/#{credential_id}", body: { api_key:, operation_id: }.to_json) end |