2021-12-16 17:22:16 +00:00
|
|
|
import json, json_serialization, strformat, chronicles
|
|
|
|
import status_go
|
2022-01-03 13:01:10 +00:00
|
|
|
import ./utils
|
|
|
|
import ./core
|
2021-12-16 17:22:16 +00:00
|
|
|
|
|
|
|
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])
|