Notifications

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.

[
  CHAN_ID, 
  TYPE, //'n' 
  [
    MTS, 
    TYPE, 
    MESSAGE_ID, 
    null, 
      NOTIFY_INFO // NOTIFY_INFO comes as an array or object and differs per notification  
    CODE, 
    STATUS, 
    TEXT,
    ...
  ]
]
  
[0,"n",[1575282446099,"fon-req",null,null,[41238905,null,null,null,-1000,null,null,null,null,null,null,null,null,null,0.002,2,null,null,null,null,null],null,"SUCCESS","Submitting funding bid of 1000.0 USD at 0.2000 for 2 days."]]
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

Stream Fields

TermTypeDescription
CHAN_IDintIdentification number for the channel subscribtion. Notification events are always sent through the account information channel with CHAN_ID = 0
TYPEstring'n' (notification)
MTSintMillisecond Time Stamp of the update
TYPEstringPurpose of notification ('on-req', 'oc-req', 'uca', 'fon-req', 'foc-req') - an overview of all types can be found in our Abbreviation Glossary
MESSAGE_IDintunique ID of the message
NOTIFY_INFOarray/objectA message containing information regarding the notification
CODEnull or integerWork in progress
STATUSstringStatus of the notification; it may vary over time (SUCCESS, ERROR, FAILURE, ...)
TEXTstringText 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.