Advertisement
dcjona

Untitled

Nov 7th, 2022
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.88 KB | None | 0 0
  1. [
  2. {
  3. "id": "6cf1e4286453fc30",
  4. "type": "group",
  5. "z": "b252dda0d4dd6d02",
  6. "name": "Streamr node notif",
  7. "style": {
  8. "label": true
  9. },
  10. "nodes": [
  11. "ba979465f2821314",
  12. "8fc3e8ab2e3af2b5",
  13. "5c75b1e85eba64ed",
  14. "9f6aa09d1186a50a",
  15. "d1e1b2fdaa0efba3",
  16. "6e24995bb0c670b7",
  17. "e7c17de827a13755",
  18. "09a7a53ecb1f699c",
  19. "34082702076f8f6f",
  20. "b4d3917280530ca1",
  21. "acfdcf2a78af6a30",
  22. "10d898338765abcb"
  23. ],
  24. "x": 34,
  25. "y": 1899,
  26. "w": 712,
  27. "h": 342
  28. },
  29. {
  30. "id": "ba979465f2821314",
  31. "type": "inject",
  32. "z": "b252dda0d4dd6d02",
  33. "g": "6cf1e4286453fc30",
  34. "name": "",
  35. "props": [
  36. {
  37. "p": "payload"
  38. },
  39. {
  40. "p": "address",
  41. "v": "0xc82e91d6656276d34465f634da39b6e94ccd5a38",
  42. "vt": "str"
  43. }
  44. ],
  45. "repeat": "",
  46. "crontab": "00 18 * * *",
  47. "once": false,
  48. "onceDelay": 0.1,
  49. "topic": "",
  50. "payload": "",
  51. "payloadType": "date",
  52. "x": 150,
  53. "y": 1940,
  54. "wires": [
  55. [
  56. "8fc3e8ab2e3af2b5"
  57. ]
  58. ]
  59. },
  60. {
  61. "id": "8fc3e8ab2e3af2b5",
  62. "type": "http request",
  63. "z": "b252dda0d4dd6d02",
  64. "g": "6cf1e4286453fc30",
  65. "name": "reward_url",
  66. "method": "GET",
  67. "ret": "obj",
  68. "paytoqs": "ignore",
  69. "url": "https://brubeck1.streamr.network:3013/datarewards/{{address}}",
  70. "tls": "",
  71. "persist": false,
  72. "proxy": "",
  73. "insecureHTTPParser": false,
  74. "authType": "",
  75. "senderr": false,
  76. "headers": [],
  77. "x": 370,
  78. "y": 1940,
  79. "wires": [
  80. [
  81. "9f6aa09d1186a50a"
  82. ]
  83. ]
  84. },
  85. {
  86. "id": "5c75b1e85eba64ed",
  87. "type": "http request",
  88. "z": "b252dda0d4dd6d02",
  89. "g": "6cf1e4286453fc30",
  90. "name": "api_telegraphe",
  91. "method": "POST",
  92. "ret": "obj",
  93. "paytoqs": "body",
  94. "url": "https://api.thegraph.com/subgraphs/name/streamr-dev/data-on-polygon",
  95. "tls": "",
  96. "persist": false,
  97. "proxy": "",
  98. "insecureHTTPParser": false,
  99. "authType": "",
  100. "senderr": false,
  101. "headers": [],
  102. "x": 340,
  103. "y": 2080,
  104. "wires": [
  105. [
  106. "e7c17de827a13755"
  107. ]
  108. ]
  109. },
  110. {
  111. "id": "9f6aa09d1186a50a",
  112. "type": "function",
  113. "z": "b252dda0d4dd6d02",
  114. "g": "6cf1e4286453fc30",
  115. "name": "reward",
  116. "func": "msg.reward_url = msg.payload\nreturn msg;",
  117. "outputs": 1,
  118. "noerr": 0,
  119. "initialize": "",
  120. "finalize": "",
  121. "libs": [],
  122. "x": 590,
  123. "y": 1940,
  124. "wires": [
  125. [
  126. "d1e1b2fdaa0efba3"
  127. ]
  128. ]
  129. },
  130. {
  131. "id": "d1e1b2fdaa0efba3",
  132. "type": "http request",
  133. "z": "b252dda0d4dd6d02",
  134. "g": "6cf1e4286453fc30",
  135. "name": "personalnodes_url",
  136. "method": "GET",
  137. "ret": "obj",
  138. "paytoqs": "ignore",
  139. "url": "https://brubeck1.streamr.network:3013/stats/{{address}}",
  140. "tls": "",
  141. "persist": false,
  142. "proxy": "",
  143. "insecureHTTPParser": false,
  144. "authType": "",
  145. "senderr": false,
  146. "headers": [],
  147. "x": 350,
  148. "y": 2020,
  149. "wires": [
  150. [
  151. "6e24995bb0c670b7"
  152. ]
  153. ]
  154. },
  155. {
  156. "id": "6e24995bb0c670b7",
  157. "type": "function",
  158. "z": "b252dda0d4dd6d02",
  159. "g": "6cf1e4286453fc30",
  160. "name": "personal / balance",
  161. "func": "msg.personalnodes_url = msg.payload\n\nmsg.payload ={\n 'query': '{\\n erc20Balances(where: {account: \"'+ msg.address +'\", contract:\"0x3a9a81d576d83ff21f26f325066054540720fc34\"}) {\\n value \\n }\\n}',\n }\n\nreturn msg;",
  162. "outputs": 1,
  163. "noerr": 0,
  164. "initialize": "",
  165. "finalize": "",
  166. "libs": [],
  167. "x": 630,
  168. "y": 2020,
  169. "wires": [
  170. [
  171. "5c75b1e85eba64ed"
  172. ]
  173. ]
  174. },
  175. {
  176. "id": "e7c17de827a13755",
  177. "type": "function",
  178. "z": "b252dda0d4dd6d02",
  179. "g": "6cf1e4286453fc30",
  180. "name": "balance / transfert",
  181. "func": "msg.balance = msg.payload\nmsg.payload =\n{\n 'query': '{\\n erc20Transfers(\\n where: {\\n from: \"0x3979f7d6b5c5bfa4bcd441b4f35bfa0731ccfaef\"\\n to: \"' + msg.address + '\"\\n timestamp_gt: \"1646065752\"\\n }\\n ) {\\n timestamp\\n value\\n }\\n}\\n',\n }\nreturn msg;",
  182. "outputs": 1,
  183. "noerr": 0,
  184. "initialize": "",
  185. "finalize": "",
  186. "libs": [],
  187. "x": 630,
  188. "y": 2080,
  189. "wires": [
  190. [
  191. "09a7a53ecb1f699c"
  192. ]
  193. ]
  194. },
  195. {
  196. "id": "09a7a53ecb1f699c",
  197. "type": "http request",
  198. "z": "b252dda0d4dd6d02",
  199. "g": "6cf1e4286453fc30",
  200. "name": "api_telegraphe",
  201. "method": "POST",
  202. "ret": "obj",
  203. "paytoqs": "body",
  204. "url": "https://api.thegraph.com/subgraphs/name/streamr-dev/data-on-polygon",
  205. "tls": "",
  206. "persist": false,
  207. "proxy": "",
  208. "insecureHTTPParser": false,
  209. "authType": "",
  210. "senderr": false,
  211. "headers": [],
  212. "x": 320,
  213. "y": 2140,
  214. "wires": [
  215. [
  216. "34082702076f8f6f"
  217. ]
  218. ]
  219. },
  220. {
  221. "id": "34082702076f8f6f",
  222. "type": "function",
  223. "z": "b252dda0d4dd6d02",
  224. "g": "6cf1e4286453fc30",
  225. "name": "balance / transfert",
  226. "func": "msg.transfert = msg.payload\ndelete msg.payload\ndelete msg.statusCode\ndelete msg.responseUrl\ndelete msg.redirectList\ndelete msg.retry\ndelete msg.header\n\nreturn msg;",
  227. "outputs": 1,
  228. "noerr": 0,
  229. "initialize": "",
  230. "finalize": "",
  231. "libs": [],
  232. "x": 630,
  233. "y": 2140,
  234. "wires": [
  235. [
  236. "b4d3917280530ca1"
  237. ]
  238. ]
  239. },
  240. {
  241. "id": "b4d3917280530ca1",
  242. "type": "function",
  243. "z": "b252dda0d4dd6d02",
  244. "g": "6cf1e4286453fc30",
  245. "name": "intel",
  246. "func": "// parse a date in yyyy-mm-dd format\nfunction dateDiff(date1, date2){\n var diff = {} // Initialisation du retour\n var tmp = date2 - date1;\n \n tmp = Math.floor(tmp/1000); // Nombre de secondes entre les 2 dates\n diff.sec = tmp % 60; // Extraction du nombre de secondes\n \n tmp = Math.floor((tmp-diff.sec)/60); // Nombre de minutes (partie entière)\n diff.min = tmp % 60; // Extraction du nombre de minutes\n \n tmp = Math.floor((tmp-diff.min)/60); // Nombre d'heures (entières)\n diff.hour = tmp % 24; // Extraction du nombre d'heures\n \n tmp = Math.floor((tmp-diff.hour)/24); // Nombre de jours restants\n diff.day = tmp;\n \n return diff;\n}\n\nmsg.first_reward = new Date(msg.personalnodes_url.claimedRewardCodes[0].claimTime).getTime()\nmsg.now = new Date().getTime();\n\nnb_reward = msg.personalnodes_url.claimedRewardCodes.length-1\nmsg.last_date = new Date(msg.personalnodes_url.claimedRewardCodes[nb_reward].claimTime).getTime()\n\nmsg.date_first_reward_diff = dateDiff(msg.first_reward, msg.now);\n// msg.nb_days =dateDiff;\nif (msg.date_first_reward_diff.hour >12)\n msg.nb_days =msg.date_first_reward_diff.day + 1;\nelse\n msg.nb_days =msg.date_first_reward_diff.day;\n\nmsg.moyenne_reward_per_days = msg.reward_url.DATA / msg.nb_days;\n\nmsg.date_last_reward_diff = dateDiff( msg.last_date,msg.now)\nif ((msg.date_last_reward_diff.hour > 1 )|| ( msg.date_last_reward_diff.hour == 1 && msg.date_last_reward_diff.minute > 30) )\n msg.status_node = \"offline\";\nelse\n msg.status_node = \"online\";\nreturn msg;",
  247. "outputs": 1,
  248. "noerr": 0,
  249. "initialize": "",
  250. "finalize": "",
  251. "libs": [],
  252. "x": 290,
  253. "y": 2200,
  254. "wires": [
  255. [
  256. "acfdcf2a78af6a30"
  257. ]
  258. ]
  259. },
  260. {
  261. "id": "acfdcf2a78af6a30",
  262. "type": "function",
  263. "z": "b252dda0d4dd6d02",
  264. "g": "6cf1e4286453fc30",
  265. "name": "data",
  266. "func": "var reward = msg.reward_url.DATA;\nvar total_Stack = msg.balance.data.erc20Balances[0].value\nvar status = msg.status_node\nvar received_rewards = msg.transfert.data.erc20Transfers[0].value\n\nmsg.reward = \"Accumulated rewards : \" + reward + \"\\n\";\nmsg.total_Stack = \"Total Stacked : \" + total_Stack + \"\\n\";\nmsg.received_rewards = \"Received rewards : \" + received_rewards + \"\\n\";\nmsg.status = \"Node Status : \" + status;\n\nvar message = msg.reward + msg.total_Stack + msg.received_rewards + msg.status;\n\nmsg.payload = { chatId: 5077529871, type: 'message', content: message };\n\n// activate markdown\nmsg.payload.options = { disable_web_page_preview: true, parse_mode: \"Markdown\" };\nreturn msg;\n\n",
  267. "outputs": 1,
  268. "noerr": 0,
  269. "initialize": "",
  270. "finalize": "",
  271. "libs": [],
  272. "x": 430,
  273. "y": 2200,
  274. "wires": [
  275. [
  276. "10d898338765abcb"
  277. ]
  278. ]
  279. },
  280. {
  281. "id": "10d898338765abcb",
  282. "type": "telegram sender",
  283. "z": "b252dda0d4dd6d02",
  284. "g": "6cf1e4286453fc30",
  285. "name": "",
  286. "bot": "ae7c2cc7aca85f86",
  287. "haserroroutput": false,
  288. "outputs": 1,
  289. "x": 630,
  290. "y": 2200,
  291. "wires": [
  292. []
  293. ]
  294. },
  295. {
  296. "id": "ae7c2cc7aca85f86",
  297. "type": "telegram bot",
  298. "botname": "streamrbot",
  299. "usernames": "",
  300. "chatids": "",
  301. "baseapiurl": "",
  302. "updatemode": "polling",
  303. "pollinterval": "300",
  304. "usesocks": false,
  305. "sockshost": "",
  306. "socksprotocol": "socks5",
  307. "socksport": "6667",
  308. "socksusername": "anonymous",
  309. "sockspassword": "",
  310. "bothost": "",
  311. "botpath": "",
  312. "localbotport": "8443",
  313. "publicbotport": "8443",
  314. "privatekey": "",
  315. "certificate": "",
  316. "useselfsignedcertificate": false,
  317. "sslterminated": false,
  318. "verboselogging": false
  319. }
  320. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement