refactor: dapp permissions (#92)

This commit is contained in:
Richard Ramos 2021-10-26 11:46:08 -04:00 committed by GitHub
parent b6a5b7e4ed
commit ad9af00340
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
import json, strmisc
import core, utils
import response_type
export response_type
proc getDappPermissions*(): RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* []
result = callPrivateRPC("permissions_getDappPermissions", payload)
proc addDappPermissions*(dapp: string, permissions: seq[string]): RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %*[{
"dapp": dapp,
"permissions": permissions
}]
result = callPrivateRPC("permissions_addDappPermissions", payload)
proc deleteDappPermissions*(dapp: string): RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* [dapp]
result = callPrivateRPC("permissions_deleteDappPermissions", payload)