status-lib/status/statusgo_backend_new/provider.nim

14 lines
573 B
Nim

import json, json_serialization, strformat, chronicles
import status_go
import accounts
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])