status-lib/status/statusgo_backend_new/provider.nim

14 lines
574 B
Nim
Raw Normal View History

import json, json_serialization, strformat, chronicles
import status_go
2022-01-03 13:01:10 +00:00
import ./utils
import ./core
logScope:
topics = "provider"
proc providerRequest*(requestType: string, message:string): RpcResponse[JsonNode] =
let jsonMessage = message.parseJson
if requestType == "web3-send-async-read-only" and jsonMessage.hasKey("payload") and jsonMessage["payload"].hasKey("password"):
jsonMessage["payload"]["password"] = newJString(hashPassword(jsonMessage["payload"]["password"].getStr()))
callPrivateRPC("provider_processRequest", %*[requestType, jsonMessage])