forked from bitfinexcom/bfx-stuff-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib-ui.js
More file actions
33 lines (30 loc) · 678 Bytes
/
lib-ui.js
File metadata and controls
33 lines (30 loc) · 678 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function addMark(wss, opts) {
opts.type = 'marker_create'
wss.send(JSON.stringify(
[0, 'n', 12345, {
type: 'ucm-ui-chart',
info: opts
}])
)
}
function clearMarks(wss) {
wss.send(JSON.stringify([0, 'n', 12345, { type: 'ucm-ui-chart', info: {
type: 'marker_clear',
} }])
)
}
function sendNotification (wss, image, link, message, sound) {
wss.send(JSON.stringify([0, 'n', 12345, { type: 'ucm-notify-ui', info: {
type: 'all',
level: 'success',
image: image,
link: link,
message: message,
sound: sound
} }]))
}
module.exports = {
clearMarks: clearMarks,
sendNotification: sendNotification,
addMark: addMark
}