title: TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object. using API nodejs
body: <p>Trying to get list of transactions from Gdax API ([link][1]): Here is the documentation for the method:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var accountID = '7d0f7d8e-dd34-4d9c-a846-06f431c381ba';
  authedClient.getAccountHistory(accountID, callback);
  // For pagination, you can include extra page arguments
  authedClient.getAccountHistory(accountID, {'before': 3000}, callback);</code></pre>
  </div>
  </div>
  </p>
  
  <p>I believe the issue is in the callback, but I don't understand how to fix it.</p>
  
  <p>Here is my implementation:</p>
  
  <p></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>self.getTransactions = function(options, callback) {
  
    var key = options.key;
    var b64secret = options.secret;
    var passphrase = options.passphrase;
  
    var Gdax = require('gdax');
    var authedClient = new Gdax.AuthenticatedClient(
      key, b64secret, passphrase);
  
    var accountID = '32fb94c4-cda2-52f1-9bae-1866a0605789';
    authedClient.getAccountHistory(accountID, function(err, response, transactions) {
      let details;
      details = {
        timestamp: util.timestampNow(),
        error: err.message,
        data: []
      };
      if (err || resp.statusCode !== 200) {
        let error = err || new Error(`Error ${resp.statusCode}: ${resp.body}`);
        result.error = error.message;
        return callback(error, result);
      }
      _.each(transactions, function(transaction) {
        let data = {
          transaction_id: transaction.id,
          total: transaction.amount,
          type: transaction.type
        };
        details.data.push(data);
      });
      callback(null, details);
    });
  
  };</code></pre>
  </div>
  </div>
  </p>