diff --git a/src/applicationLogic.nim b/src/applicationLogic.nim index 564734b4bc..710ef78a0b 100644 --- a/src/applicationLogic.nim +++ b/src/applicationLogic.nim @@ -14,9 +14,12 @@ QtObject: result.setup() status.setupNewAccount() + discard status.addPeer("enode://2c8de3cbb27a3d30cbb5b3e003bc722b126f5aef82e2052aaef032ca94e0c7ad219e533ba88c70585ebd802de206693255335b100307645ab5170e88620d2a81@47.244.221.14:443") + echo status.callPrivateRPC("{\"jsonrpc\":\"2.0\", \"method\":\"wakuext_requestMessages\", \"params\":[{\"topics\": [\"0x7998f3c8\"]}], \"id\": 1}") # ¯\_(ツ)_/¯ dunno what is this proc setup(self: ApplicationLogic) = + # discard status.onMessage(self.onMessage) self.QObject.setup # ¯\_(ツ)_/¯ seems to be a method for garbage collection @@ -47,5 +50,9 @@ QtObject: notify = callResultChanged proc onSend*(self: ApplicationLogic, inputJSON: string) {.slot.} = - self.setCallResult(status.callRPC(inputJSON)) + self.setCallResult(status.callPrivateRPC(inputJSON)) echo "Done!: ", self.callResult + + # proc onMessage*(self: ApplicationLogic, message: string) {.slot.} = + # self.setCallResult(message) + # echo "Received message: ", message diff --git a/src/libstatus.nim b/src/libstatus.nim index 2bfe1f245a..29ce3c8661 100644 --- a/src/libstatus.nim +++ b/src/libstatus.nim @@ -11,3 +11,9 @@ proc multiAccountStoreDerivedAccounts*(paramsJSON: cstring): cstring {.importc: proc saveAccountAndLogin*(accountData: cstring, password: cstring, settingsJSON: cstring, configJSON: cstring, subaccountData: cstring): cstring {.importc: "SaveAccountAndLogin".} proc callRPC*(inputJSON: cstring): cstring {.importc: "CallRPC".} + +proc callPrivateRPC*(inputJSON: cstring): cstring {.importc: "CallPrivateRPC".} + +proc addPeer*(peer: cstring): cstring {.importc: "AddPeer".} + +# proc setSignalEventCallback*(callback: proc): void {.importc: "SetSignalEventCallback".} diff --git a/src/status.nim b/src/status.nim index 9e42123d8c..3cc6aa5819 100644 --- a/src/status.nim +++ b/src/status.nim @@ -269,3 +269,12 @@ proc setupNewAccount*() = proc callRPC*(inputJSON: string): string = return $libstatus.callRPC(inputJSON) + +proc callPrivateRPC*(inputJSON: string): string = + return $libstatus.callPrivateRPC(inputJSON) + +proc addPeer*(peer: string): string = + return $libstatus.addPeer(peer) + +# proc onMessage*(callback: proc(message: string)): void = +# $libstatus.setSignalEventCallback(callback)