Signal Sent via HTTP
This commit is contained in:
1 parent
cbb1de0747
commit
a90c8256ac
2 files changed
+15
-11
No files matched your search
@@ -49,9 +49,9 @@ exports.newNetworkModulesHttpNetworkClient = function newNetworkModulesHttpNetwo
|
||||
messageId: SA.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId(),
|
||||
messageType: 'Request',
|
||||
signature: JSON.stringify(signature),
|
||||
payload: message
|
||||
payload: JSON.stringify(message)
|
||||
}
|
||||
|
||||
const fetch = SA.nodeModules.nodeFetch
|
||||
const response = await fetch('https://' + thisObject.host + ':' + thisObject.port + '/' + 'New-Signal', {
|
||||
method: 'post',
|
||||
body: JSON.stringify(body),
|
||||
|
||||
@@ -17,16 +17,20 @@ exports.newTradingSignalsModulesOutgoingTradingSignals = function (processIndex)
|
||||
function broadcastSignal(node) {
|
||||
if (node === undefined) { return }
|
||||
if (node.outgoingSignals === undefined) { return }
|
||||
if (node.outgoingSignals.signalReference === undefined) { return }
|
||||
if (node.outgoingSignals.signalReference.referenceParent === undefined) { return }
|
||||
if (node.outgoingSignals.signalReferences === undefined) { return }
|
||||
|
||||
let signalMessage = {
|
||||
signalId: SA.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId(),
|
||||
tradingSystemNodeType: node.type,
|
||||
socialTradingBotNodeType: node.outgoingSignals.signalReference.referenceParent.id,
|
||||
socialTradingBotNodeId: node.outgoingSignals.signalReference.referenceParent.id
|
||||
for (let i = 0; i < node.outgoingSignals.signalReferences.length; i++) {
|
||||
let signalReference = node.outgoingSignals.signalReferences[i]
|
||||
if (signalReference.referenceParent === undefined) { return }
|
||||
|
||||
let signalMessage = {
|
||||
signalId: SA.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId(),
|
||||
tradingSystemNodeType: node.type,
|
||||
socialTradingBotNodeType: signalReference.referenceParent.type,
|
||||
socialTradingBotNodeId: signalReference.referenceParent.id
|
||||
}
|
||||
|
||||
TS.projects.foundations.globals.taskConstants.P2P_NETWORK.p2pNetworkStart.sendMessage(signalMessage)
|
||||
}
|
||||
|
||||
TS.projects.foundations.globals.taskConstants.P2P_NETWORK.p2pNetworkStart.sendMessage(signalMessage)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user