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
797 B
26 lines
797 B
package controllers
|
|
|
|
import com.xsn.explorer.models.request.SendRawTransactionRequest
|
|
import com.xsn.explorer.services.TransactionRPCService
|
|
import controllers.common.{MyJsonController, MyJsonControllerComponents}
|
|
import javax.inject.Inject
|
|
|
|
class TransactionsController @Inject() (
|
|
transactionRPCService: TransactionRPCService,
|
|
cc: MyJsonControllerComponents)
|
|
extends MyJsonController(cc) {
|
|
|
|
import Context._
|
|
|
|
def getTransaction(txid: String) = public { _ =>
|
|
transactionRPCService.getTransactionDetails(txid)
|
|
}
|
|
|
|
def getRawTransaction(txid: String) = public { _ =>
|
|
transactionRPCService.getRawTransaction(txid)
|
|
}
|
|
|
|
def sendRawTransaction() = publicInput { ctx: HasModel[SendRawTransactionRequest] =>
|
|
transactionRPCService.sendRawTransaction(ctx.model.hex)
|
|
}
|
|
}
|
|
|