function sign(transaction, privateKey, sighashType, inputIndex, subscript, signingMethod) {
  signingMethod = signingMethod || 'ecdsa';

  if(signingMethod === 'ecdsa') {
    const hashbuf = sighash(transaction, sighashType, inputIndex, subscript);
    const sig = ECDSA.sign(hashbuf, privateKey, { endian: 'little' });
    sig.nhashtype = sighashType;
    return sig;
   }
  throw new Error('signingMethod not supported ', signingMethod);
}
Create a signature

@name Signing.sign
@param {Transaction} transaction
@param {PrivateKey} privateKey
@param {number} sighash
@param {number} inputIndex
@param {Script} subscript
@param {String} signingMethod - method used to sign - 'ecdsa' or 'schnorr' (future signing method)
@return {Signature}