refactor: dapp permissions (#92)
This commit is contained in:
parent
b6a5b7e4ed
commit
ad9af00340
|
@ -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)
|
Loading…
Reference in New Issue