message: Typescriptify internal.ts
diff: -// File for internal functions
  -
  import * as Bluebird from 'bluebird';
  +import { BaseCoin } from './baseCoin';
  +
  +const co = Bluebird.coroutine;
  /**
  * Internal function to centralize this route for wallet-scoped and enterprise-scoped queries
  @@ -10,7 +11,8 @@ import * as Bluebird from 'bluebird';
  * @param bitgo The BitGo object
  * @returns result of the query
  */
  -export function getFirstPendingTransaction(params, baseCoin, bitgo): Bluebird<any> {
  +export function getFirstPendingTransaction(params: { walletId?: string, enterpriseId?: string }, baseCoin: BaseCoin, bitgo: any): Bluebird<any> {
  + return co(function *() {
  // These errors should never happen when this is called from wallet.js or enterprise.js
  if (!baseCoin) {
  throw new Error('Must provide baseCoin');
  @@ -24,10 +26,16 @@ export function getFirstPendingTransaction(params, baseCoin, bitgo): Bluebird<an
  return bitgo.get(baseCoin.url('/tx/pending/first'))
  .query(params)
  .result();
  + }).call(this);
  }
  -// convert a 4 element Uint8Array to a 4 byte Number
  -export function bytesToWord(bytes) {
  +/**
  + * convert a 4 element Uint8Array to a 4 byte Number
  + *
  + * @param bytes
  + * @return 4 byte number
  + */
  +export function bytesToWord(bytes: Uint8Array): number {
  if (!(bytes instanceof Uint8Array) || bytes.length !== 4) {
  throw new Error('bytes must be a Uint8Array with length 4');
  }
  