message: add transaction broadcast service api signatures
diff: @@ -103,7 +103,24 @@ class BlockstackNetwork {
  })
  }
  - broadcastTransaction(transaction: string) {
  + /**
  + * Broadcasts a signed bitcoin transaction to the network optionally waiting to broadcast the
  + * transaction until a second transaction has a certain number of confirmations.
  + *
  + * @param {string} transaction the hex-encoded transaction to broadcast
  + * @param {string} transactionToWatch the hex transaction id of the transaction to watch for
  + * the specified number of confirmations before broadcasting the `transaction`
  + * @param {number} confirmations the number of confirmations `transactionToWatch` must have
  + * before broadcasting `transaction`.
  + * @return {Promise} returns a Promise that resolves if the request
  + * is accepted by the transaction broadcast service and rejects
  + * if the service responds with an error or is unreachable
  + */
  + broadcastTransaction(transaction: string,
  + transactionToWatch: ?string = null,
  + confirmations: number = 6) {
  +
  + if (transactionToWatch === null) {
  const form = new FormData()
  form.append('tx', transaction)
  return fetch(`${this.utxoProviderUrl}/pushtx?cors=true`,
  @@ -121,8 +138,79 @@ class BlockstackNetwork {
  throw new Error(`Broadcast transaction failed with message: ${respText}`)
  }
  })
  + } else {
  + /*
  + * POST /v1/broadcast
  + * Request body:
  + * JSON.stringify({
  + * transaction,
  + * transactionToWatch,
  + * confirmations
  + * })
  + */
  + }
  + }
  +
  + /**
  + * Broadcasts a zone file to the Atlas network via the transaction broadcast service.
  + *
  + * @param {String} zoneFile the zone file to be broadcast to the Atlas network
  + * @param {String} transactionToWatch the hex transaction id of the transaction to watch for confirmation
  + * before broadcasting the zone file to the Atlas network
  + * @return {Promise} returns a Promise that resolves if the request
  + * is accepted by the transaction broadcast service and rejects
  + * if the service responds with an error or is unreachable
  + */
  + broadcastZoneFile(zoneFile: string,
  + transactionToWatch: ?string = null) {
  + /*
  + * POST /v1/broadcastZoneFile
  + * Request body:
  + * JSON.stringify({
  + * zoneFile,
  + * transactionToWatch
  + * })
  + */
  }
  + /**
  + * Sends the preorder and registration transactions and zone file
  + * for a Blockstack name registration
  + * along with the to the transaction broadcast service.
  + *
  + * The transaction broadcast:
  + *
  + * * immediately broadcasts the preorder transaction
  + * * broadcasts the register transactions after the preorder transaction
  + * has an appropriate number of confirmations
  + * * broadcasts the zone file to the Atlas network after the register transaction
  + * has an appropriate number of confirmations
  + *
  + * @param {String} preorderTransaction the hex-encoded, signed preorder transaction generated
  + * using the `makePreorder` function
  + * @param {String} registerTransaction the hex-encoded, signed register transaction generated
  + * using the `makeRegister` function
  + * @param {String} zoneFile the zone file to be broadcast to the Atlas network
  + * @return {Promise} returns a Promise that resolves if the request
  + * is accepted by the transaction broadcast service and rejects if the service
  + * responds with an error or is unreachable
  + */
  + broadcastNameRegistration(preorderTransaction: string,
  + registerTransaction: string,
  + zoneFile: string) {
  +
  + /*
  + * POST /v1/broadcastNameRegistration
  + * Request body:
  + * JSON.stringify({
  + * preorderTransaction,
  + * registerTransaction,
  + * zoneFile
  + * })
  + */
  + }
  +
  +
  getTransactionInfo(txHash: string) : Promise<{block_height: Number}> {
  return fetch(`${this.utxoProviderUrl}/rawtx/${txHash}`)
  .then(resp => {
  