function sign(transaction, privateKey, sighashType, inputIndex, scriptCode, satoshisBuffer, signingMethod) {
  signingMethod = signingMethod || 'ecdsa';
  var sig;

  if (signingMethod === 'ecdsa') {
    let hashbuf = sighash(transaction, sighashType, inputIndex, scriptCode, satoshisBuffer);
    sig = ECDSA.sign(hashbuf, privateKey).set({
      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'
@return {Signature}