openbazaar.js
async function getNotifications(config) {
  try {
    const options = {
      method: "GET",
      uri: `${config.obServer}:${config.obPort}/ob/notifications`,
      json: true, // Automatically stringifies the body to JSON
      headers: {
        Authorization: config.apiCredentials,
      },
      // resolveWithFullResponse: true
    };

    return rp(options);
  } catch (err) {
    console.error(`Error in openbazaar.js/getNotifications(): ${err}`);
    console.error(`Error stringified: ${JSON.stringify(err, null, 2)}`);
    throw err;
  }
}
async function getNotifications(config) {
  try {
    const options = {
      method: "GET",
      uri: `${config.obServer}:${config.obPort}/ob/notifications`,
      json: true, // Automatically stringifies the body to JSON
      headers: {
        Authorization: config.apiCredentials,
      },
      // resolveWithFullResponse: true
    };

    return rp(options);
  } catch (err) {
    console.error(`Error in openbazaar.js/getNotifications(): ${err}`);
    console.error(`Error stringified: ${JSON.stringify(err, null, 2)}`);
    throw err;
  }
}
async function getNotifications ( config ) { try { const options = { method : "GET" , uri : ` ${ config . obServer } ${ config . obPort } ` , json : true , // Automatically stringifies the body to JSON headers : { Authorization : config . apiCredentials , } , // resolveWithFullResponse: true } ; return rp ( options ) ; } catch ( err ) { console . error ( ` ${ err } ` ) ; console . error ( ` ${ JSON . stringify ( err , null , 2 ) } ` ) ; throw err ; } }
This function returns a Promise that resolves to a list of notifications recieved by the OB store.
This function returns a Promise that resolves to a list of notifications recieved by the OB store .