status-lib/status/gif.nim

34 lines
1.1 KiB
Nim
Raw Permalink Normal View History

import json, strutils, chronicles, core
import response_type
2021-09-08 18:05:39 +00:00
import status_go
2021-09-08 18:05:39 +00:00
export response_type
2021-09-08 18:05:39 +00:00
logScope:
topics = "rpc-gif"
2021-09-08 18:05:39 +00:00
proc setTenorAPIKey*(key: string): RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* [key]
result = core.callPrivateRPC("gif_setTenorAPIKey", payload)
2021-09-08 18:05:39 +00:00
proc fetchGifs*(path: string): RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* [path]
result = core.callPrivateRPC("gif_fetchGifs", payload)
2021-09-08 18:05:39 +00:00
proc updateRecentGifs*(recentGifs: JsonNode): RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* [recentGifs]
return core.callPrivateRPC("gif_updateRecentGifs", payload)
2021-09-08 18:05:39 +00:00
proc updateFavoriteGifs*(favoriteGifs: JsonNode): RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* [favoriteGifs]
return core.callPrivateRPC("gif_updateFavoriteGifs", payload)
2021-09-08 18:05:39 +00:00
proc getRecentGifs*(): RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* []
return core.callPrivateRPC("gif_getRecentGifs", payload)
proc getFavoriteGifs*(): RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* []
return core.callPrivateRPC("gif_getFavoriteGifs", payload)