refactor: methods for store/delete identity image added

This commit is contained in:
Sale Djenic 2022-02-01 10:51:08 +01:00 committed by saledjenic
parent 749fdd33c4
commit 2585f9418f
1 changed files with 8 additions and 15 deletions

View File

@ -262,18 +262,11 @@ proc verifyAccountPassword*(address: string, password: string, keystoreDir: stri
return false
proc generateAccount*(password, name, color: string): RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* [hashPassword(password), name, color]
return core.callPrivateRPC("accounts_generateAccount", payload)
proc storeIdentityImage*(keyUID: string, imagePath: string, aX, aY, bX, bY: int):
RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* [keyUID, imagePath, aX, aY, bX, bY]
result = core.callPrivateRPC("multiaccounts_storeIdentityImage", payload)
proc addAccountWithMnemonic*(mnemonic, password, name, color: string): RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* [mnemonic, hashPassword(password), name, color]
return core.callPrivateRPC("accounts_addAccountWithMnemonic", payload)
proc addAccountWithPrivateKey*(privateKey, password, name, color: string): RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* [privateKey, hashPassword(password), name, color]
return core.callPrivateRPC("accounts_addAccountWithPrivateKey", payload)
proc addAccountWatch*(address, name, color: string): RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* [address, name, color]
return core.callPrivateRPC("accounts_addAccountWatch", payload)
proc deleteIdentityImage*(keyUID: string): RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* [keyUID]
result = core.callPrivateRPC("multiaccounts_deleteIdentityImage", payload)