You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

26 lines
779 B

package controllers
import com.xsn.explorer.models.request.SendRawTransactionRequest
import com.xsn.explorer.services.TransactionService
import controllers.common.{MyJsonController, MyJsonControllerComponents}
import javax.inject.Inject
class TransactionsController @Inject() (
transactionService: TransactionService,
cc: MyJsonControllerComponents)
extends MyJsonController(cc) {
import Context._
def getTransaction(txid: String) = public { _ =>
transactionService.getTransactionDetails(txid)
}
def getRawTransaction(txid: String) = public { _ =>
transactionService.getRawTransaction(txid)
}
def sendRawTransaction() = publicInput { ctx: HasModel[SendRawTransactionRequest] =>
transactionService.sendRawTransaction(ctx.model.hex)
}
}