The Notifications channel is a work in progress that will be used for different changes in status, price alerts, etc.
Subscribe to the account information channel to keep track of your notifications. The account information channel will provide a feed of your notifications for as long as the channel remains open. Any authenticated connection is automatically subscribed to the account information channel.
Example code to open an authenticated connection can be found on our Authenticated Channels Page.
Notification events are sent with CHAN_ID = 0 and can be identified by looking at the TYPE stream field. Notification events can be recognised by the 'n' (notification) abbreviation.
[
0, //CHAN_ID
"n", //TYPE
[
1575282446099, //MTS
"fon-req", //TYPE
null, //MESSAGE_ID
null, //PLACEHOLDER
[
//Notification goes here, comes as an array or object and is different per notification
], //NOTIFY_INFO
null, //CODE
"SUCCESS", //STATUS
"Submitting funding bid of 1000.0 USD at 0.2000 for 2 days." //TEXT
] //NOTIFY_UPDATE_ARRAY
]
notify_info = [
ID,
GID,
CID,
SYMBOL,
MTS_CREATE,
MTS_UPDATE,
AMOUNT,
AMOUNT_ORIG,
TYPE,
TYPE_PREV,
_PLACEHOLDER,
_PLACEHOLDER,
FLAGS,
STATUS,
_PLACEHOLDER,
_PLACEHOLDER,
PRICE,
PRICE_AVG,
PRICE_TRAILING,
PRICE_AUX_LIMIT,
_PLACEHOLDER,
_PLACEHOLDER,
_PLACEHOLDER,
NOTIFY,
HIDDEN,
PLACED_ID,
...
]
notify_info = [
KEY,
‘price’,
SYMBOL,
PRICE,
COUNT,
DIRECTION
]
notify_info = [
ID,
SYMBOL,
MTS_CREATED,
MTS_UPDATED,
AMOUNT,
AMOUNT_ORIG,
TYPE,
_PLACEHOLDER,
_PLACEHOLDER,
FLAGS,
STATUS,
_PLACEHOLDER,
_PLACEHOLDER,
_PLACEHOLDER,
RATE,
PERIOD,
NOTIFY,
HIDDEN,
_PLACEHOLDER,
RENEW,
RATE_REAL,
...
]
Work In Progress
This section (Notifications) is currently a work in progress, but it will be a way to be alerted as to different changes in status, price alerts, etc
Notification update data
Index | Term | Type | Description |
---|---|---|---|
[0] | CHAN_ID | Int | Identification number for the channel subscribtion. Funding trades events are always sent through the account information channel with CHAN_ID = 0 |
[1] | TYPE | String | 'fte' (funding trade executed), 'ftu' (funding trade update) |
[2] | NOTIFY_UPDATE_ARRAY | Array | Notify update array |
Notify update arrays (Index [2])
Index | Field | Type | Description |
---|---|---|---|
[0] | MTS | Int | Millisecond Time Stamp of the update |
[1] | TYPE | String | Purpose of notification ('on-req', 'oc-req', 'uca', 'fon-req', 'foc-req') - an overview of all types can be found in our Abbreviation Glossary |
[2] | MESSAGE_ID | Int | Unique ID of the message |
[ . . . ] | |||
[4] | NOTIFY_INFO | Array/Object | A message containing information regarding the notification |
[5] | CODE | Null or Integer | Work in progress |
[6] | STATUS | String | Status of the notification; it may vary over time (SUCCESS, ERROR, FAILURE, ...) |
[7] | TEXT | String | Text of the notification |
Custom Notifications
The following javascript example will allow you to create a custom notification.
const obj = [
0,
'n',
MESSAGE_ID, // can be null
{
type: 'ucm-test',
info: {
foo: 1,
bar: 2
}
}
]
w1.send(JSON.stringify(obj))
A custom notification will be broadcasted to every channel that the user is subscribed to.