message: Refactor: `sendWithConfirmation` sw wallet method
diff: @@ -184,6 +184,34 @@ class SoftwareWallet extends EtherWallet {
  warning(messages.noPrivateKey, this.privateKey, { level: 'high' });
  return Promise.reject();
  }
  + /**
  + * Wrapper method for `sendTransaction()` that waits for confirmation before
  + * sending the transaction.
  + *
  + * @TODO Replace `data` type with a Transaction Type
  + *
  + * @method sendWithConfirmation
  + *
  + * @param {object} data transaction object. Does not work with signed, "hex" transaction data.
  + * @param {Promise|boolean} confirmation A boolean or a promise that returns a boolean.
  + *
  + * @return {Promise} the transactin promise (if it was sent), or a rejected promise if it failed
  + * (failed either by proving wrong transaction data or by denying it)
  + */
  + async sendWithConfirmation(
  + data: Object,
  + confirmation: Promise<boolean> | boolean = false,
  + ) {
  + if (!data || typeof data !== 'object') {
  + warning(messages.transactionData, data, { level: 'high' });
  + return Promise.reject();
  + }
  + if (await confirmation) {
  + return this.sendTransaction(data);
  + }
  + warning(messages.transactionConfirmationFail, [data]);
  + return Promise.reject();
  + }
  /**
  * Create a new wallet.
  *
  @@ -313,12 +341,6 @@ class SoftwareWallet extends EtherWallet {
  throw new Error();
  }
  }
  - static async sendTransactionWithConfirmation(transactionArgumentsObject) {
  - if (transactionArgumentsObject.confirmation) {
  - return this.sendTransaction(transactionArgumentsObject.transaction);
  - }
  - throw new Error('Transaction was not confirmed');
  - }
  }
  /*
  