mirror of
https://github.com/status-im/status-lib.git
synced 2025-01-12 13:35:00 +00:00
c7722cda00
* refactor: Group profile function and eth function together * refactor: group eth backend * refactor: Move various eth call to eth backend * refactor: move accounts call to account backend * refactor: permission
24 lines
456 B
Nim
24 lines
456 B
Nim
import sets
|
|
import strutils
|
|
import chronicles
|
|
|
|
logScope:
|
|
topics = "permission-type"
|
|
|
|
type
|
|
Permission* {.pure.} = enum
|
|
Web3 = "web3",
|
|
ContactCode = "contact-code"
|
|
Unknown = "unknown"
|
|
|
|
type Dapp* = object
|
|
name*: string
|
|
permissions*: HashSet[Permission]
|
|
|
|
proc toPermission*(value: string): Permission =
|
|
result = Permission.Unknown
|
|
try:
|
|
result = parseEnum[Permission](value)
|
|
except:
|
|
warn "Unknown permission requested", value
|