src/caplinked-utils.js
function signedRequestHeaders(apiKey, apiSecretKey, apiUserToken, options) {
  if (!apiKey || !apiSecretKey || !apiUserToken) {
    return false;
  }
  var apiExpDate = Math.floor(Date.now() / 1000) + 600;
  var payload = apiKey + apiUserToken + apiExpDate;
  var hash = CryptoJS.HmacSHA256(payload, apiSecretKey);
  var headers = {
    'x-api-key': apiKey,
    'x-api-user-token': apiUserToken,
    'x-api-signature': 'Method=HMAC-SHA256 Signature=' + hash,
    'x-api-exp-date': apiExpDate,
  };
  return headers;
}
function signedRequestHeaders(apiKey, apiSecretKey, apiUserToken, options) {
  if (!apiKey || !apiSecretKey || !apiUserToken) {
    return false;
  }
  var apiExpDate = Math.floor(Date.now() / 1000) + 600;
  var payload = apiKey + apiUserToken + apiExpDate;
  var hash = CryptoJS.HmacSHA256(payload, apiSecretKey);
  var headers = {
    'x-api-key': apiKey,
    'x-api-user-token': apiUserToken,
    'x-api-signature': 'Method=HMAC-SHA256 Signature=' + hash,
    'x-api-exp-date': apiExpDate,
  };
  return headers;
}
function signedRequestHeaders ( apiKey , apiSecretKey , apiUserToken , options ) { if ( ! apiKey || ! apiSecretKey || ! apiUserToken ) { return false ; } var apiExpDate = Math . floor ( Date . now ( ) / 1000 ) + 600 ; var payload = apiKey + apiUserToken + apiExpDate ; var hash = CryptoJS . HmacSHA256 ( payload , apiSecretKey ) ; var headers = { 'x-api-key' : apiKey , 'x-api-user-token' : apiUserToken , 'x-api-signature' : 'Method=HMAC-SHA256 Signature=' + hash , 'x-api-exp-date' : apiExpDate , } ; return headers ; }
Return an Object of headers to attach to a request
Return an Object of headers to attach to a request