diff --git a/status/statusgo_backend_new/permissions.nim b/status/statusgo_backend_new/permissions.nim new file mode 100644 index 0000000..412bb85 --- /dev/null +++ b/status/statusgo_backend_new/permissions.nim @@ -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)