xyz.stratalab.indexer.services.TransactionServiceFs2Grpc.scala Maven / Gradle / Ivy
The newest version!
package xyz.stratalab.indexer.services
import _root_.cats.syntax.all._
trait TransactionServiceFs2Grpc[F[_], A] {
def getTransactionById(request: xyz.stratalab.indexer.services.GetTransactionByIdRequest, ctx: A): F[xyz.stratalab.indexer.services.TransactionResponse]
def getTransactionByLockAddressStream(request: xyz.stratalab.indexer.services.QueryByLockAddressRequest, ctx: A): _root_.fs2.Stream[F, xyz.stratalab.indexer.services.TransactionResponse]
def getTxosByLockAddress(request: xyz.stratalab.indexer.services.QueryByLockAddressRequest, ctx: A): F[xyz.stratalab.indexer.services.TxoLockAddressResponse]
def getTxosByLockAddressStream(request: xyz.stratalab.indexer.services.QueryByLockAddressRequest, ctx: A): _root_.fs2.Stream[F, xyz.stratalab.indexer.services.TxoLockAddressResponse]
def getTxosByAssetLabel(request: xyz.stratalab.indexer.services.QueryByAssetLabelRequest, ctx: A): _root_.fs2.Stream[F, xyz.stratalab.indexer.services.TxoResponse]
def createOnChainTransactionIndex(request: xyz.stratalab.indexer.services.CreateOnChainTransactionIndexRequest, ctx: A): F[xyz.stratalab.indexer.services.CreateOnChainTransactionIndexResponse]
def getExistingTransactionIndexes(request: xyz.stratalab.indexer.services.GetExistingTransactionIndexesRequest, ctx: A): F[xyz.stratalab.indexer.services.GetExistingTransactionIndexesResponse]
def getIndexedTransactions(request: xyz.stratalab.indexer.services.GetIndexedTransactionsRequest, ctx: A): _root_.fs2.Stream[F, xyz.stratalab.indexer.services.TransactionResponse]
def dropIndex(request: xyz.stratalab.indexer.services.DropIndexRequest, ctx: A): F[xyz.stratalab.indexer.services.DropIndexResponse]
}
object TransactionServiceFs2Grpc extends _root_.fs2.grpc.GeneratedCompanion[TransactionServiceFs2Grpc] {
def mkClient[F[_]: _root_.cats.effect.Async, A](dispatcher: _root_.cats.effect.std.Dispatcher[F], channel: _root_.io.grpc.Channel, mkMetadata: A => F[_root_.io.grpc.Metadata], clientOptions: _root_.fs2.grpc.client.ClientOptions): TransactionServiceFs2Grpc[F, A] = new TransactionServiceFs2Grpc[F, A] {
def getTransactionById(request: xyz.stratalab.indexer.services.GetTransactionByIdRequest, ctx: A): F[xyz.stratalab.indexer.services.TransactionResponse] = {
mkMetadata(ctx).flatMap { m =>
_root_.fs2.grpc.client.Fs2ClientCall[F](channel, xyz.stratalab.indexer.services.TransactionServiceGrpc.METHOD_GET_TRANSACTION_BY_ID, dispatcher, clientOptions).flatMap(_.unaryToUnaryCall(request, m))
}
}
def getTransactionByLockAddressStream(request: xyz.stratalab.indexer.services.QueryByLockAddressRequest, ctx: A): _root_.fs2.Stream[F, xyz.stratalab.indexer.services.TransactionResponse] = {
_root_.fs2.Stream.eval(mkMetadata(ctx)).flatMap { m =>
_root_.fs2.Stream.eval(_root_.fs2.grpc.client.Fs2ClientCall[F](channel, xyz.stratalab.indexer.services.TransactionServiceGrpc.METHOD_GET_TRANSACTION_BY_LOCK_ADDRESS_STREAM, dispatcher, clientOptions)).flatMap(_.unaryToStreamingCall(request, m))
}
}
def getTxosByLockAddress(request: xyz.stratalab.indexer.services.QueryByLockAddressRequest, ctx: A): F[xyz.stratalab.indexer.services.TxoLockAddressResponse] = {
mkMetadata(ctx).flatMap { m =>
_root_.fs2.grpc.client.Fs2ClientCall[F](channel, xyz.stratalab.indexer.services.TransactionServiceGrpc.METHOD_GET_TXOS_BY_LOCK_ADDRESS, dispatcher, clientOptions).flatMap(_.unaryToUnaryCall(request, m))
}
}
def getTxosByLockAddressStream(request: xyz.stratalab.indexer.services.QueryByLockAddressRequest, ctx: A): _root_.fs2.Stream[F, xyz.stratalab.indexer.services.TxoLockAddressResponse] = {
_root_.fs2.Stream.eval(mkMetadata(ctx)).flatMap { m =>
_root_.fs2.Stream.eval(_root_.fs2.grpc.client.Fs2ClientCall[F](channel, xyz.stratalab.indexer.services.TransactionServiceGrpc.METHOD_GET_TXOS_BY_LOCK_ADDRESS_STREAM, dispatcher, clientOptions)).flatMap(_.unaryToStreamingCall(request, m))
}
}
def getTxosByAssetLabel(request: xyz.stratalab.indexer.services.QueryByAssetLabelRequest, ctx: A): _root_.fs2.Stream[F, xyz.stratalab.indexer.services.TxoResponse] = {
_root_.fs2.Stream.eval(mkMetadata(ctx)).flatMap { m =>
_root_.fs2.Stream.eval(_root_.fs2.grpc.client.Fs2ClientCall[F](channel, xyz.stratalab.indexer.services.TransactionServiceGrpc.METHOD_GET_TXOS_BY_ASSET_LABEL, dispatcher, clientOptions)).flatMap(_.unaryToStreamingCall(request, m))
}
}
def createOnChainTransactionIndex(request: xyz.stratalab.indexer.services.CreateOnChainTransactionIndexRequest, ctx: A): F[xyz.stratalab.indexer.services.CreateOnChainTransactionIndexResponse] = {
mkMetadata(ctx).flatMap { m =>
_root_.fs2.grpc.client.Fs2ClientCall[F](channel, xyz.stratalab.indexer.services.TransactionServiceGrpc.METHOD_CREATE_ON_CHAIN_TRANSACTION_INDEX, dispatcher, clientOptions).flatMap(_.unaryToUnaryCall(request, m))
}
}
def getExistingTransactionIndexes(request: xyz.stratalab.indexer.services.GetExistingTransactionIndexesRequest, ctx: A): F[xyz.stratalab.indexer.services.GetExistingTransactionIndexesResponse] = {
mkMetadata(ctx).flatMap { m =>
_root_.fs2.grpc.client.Fs2ClientCall[F](channel, xyz.stratalab.indexer.services.TransactionServiceGrpc.METHOD_GET_EXISTING_TRANSACTION_INDEXES, dispatcher, clientOptions).flatMap(_.unaryToUnaryCall(request, m))
}
}
def getIndexedTransactions(request: xyz.stratalab.indexer.services.GetIndexedTransactionsRequest, ctx: A): _root_.fs2.Stream[F, xyz.stratalab.indexer.services.TransactionResponse] = {
_root_.fs2.Stream.eval(mkMetadata(ctx)).flatMap { m =>
_root_.fs2.Stream.eval(_root_.fs2.grpc.client.Fs2ClientCall[F](channel, xyz.stratalab.indexer.services.TransactionServiceGrpc.METHOD_GET_INDEXED_TRANSACTIONS, dispatcher, clientOptions)).flatMap(_.unaryToStreamingCall(request, m))
}
}
def dropIndex(request: xyz.stratalab.indexer.services.DropIndexRequest, ctx: A): F[xyz.stratalab.indexer.services.DropIndexResponse] = {
mkMetadata(ctx).flatMap { m =>
_root_.fs2.grpc.client.Fs2ClientCall[F](channel, xyz.stratalab.indexer.services.TransactionServiceGrpc.METHOD_DROP_INDEX, dispatcher, clientOptions).flatMap(_.unaryToUnaryCall(request, m))
}
}
}
protected def serviceBinding[F[_]: _root_.cats.effect.Async, A](dispatcher: _root_.cats.effect.std.Dispatcher[F], serviceImpl: TransactionServiceFs2Grpc[F, A], mkCtx: _root_.io.grpc.Metadata => F[A], serverOptions: _root_.fs2.grpc.server.ServerOptions): _root_.io.grpc.ServerServiceDefinition = {
_root_.io.grpc.ServerServiceDefinition
.builder(xyz.stratalab.indexer.services.TransactionServiceGrpc.SERVICE)
.addMethod(xyz.stratalab.indexer.services.TransactionServiceGrpc.METHOD_GET_TRANSACTION_BY_ID, _root_.fs2.grpc.server.Fs2ServerCallHandler[F](dispatcher, serverOptions).unaryToUnaryCall[xyz.stratalab.indexer.services.GetTransactionByIdRequest, xyz.stratalab.indexer.services.TransactionResponse]((r, m) => mkCtx(m).flatMap(serviceImpl.getTransactionById(r, _))))
.addMethod(xyz.stratalab.indexer.services.TransactionServiceGrpc.METHOD_GET_TRANSACTION_BY_LOCK_ADDRESS_STREAM, _root_.fs2.grpc.server.Fs2ServerCallHandler[F](dispatcher, serverOptions).unaryToStreamingCall[xyz.stratalab.indexer.services.QueryByLockAddressRequest, xyz.stratalab.indexer.services.TransactionResponse]((r, m) => _root_.fs2.Stream.eval(mkCtx(m)).flatMap(serviceImpl.getTransactionByLockAddressStream(r, _))))
.addMethod(xyz.stratalab.indexer.services.TransactionServiceGrpc.METHOD_GET_TXOS_BY_LOCK_ADDRESS, _root_.fs2.grpc.server.Fs2ServerCallHandler[F](dispatcher, serverOptions).unaryToUnaryCall[xyz.stratalab.indexer.services.QueryByLockAddressRequest, xyz.stratalab.indexer.services.TxoLockAddressResponse]((r, m) => mkCtx(m).flatMap(serviceImpl.getTxosByLockAddress(r, _))))
.addMethod(xyz.stratalab.indexer.services.TransactionServiceGrpc.METHOD_GET_TXOS_BY_LOCK_ADDRESS_STREAM, _root_.fs2.grpc.server.Fs2ServerCallHandler[F](dispatcher, serverOptions).unaryToStreamingCall[xyz.stratalab.indexer.services.QueryByLockAddressRequest, xyz.stratalab.indexer.services.TxoLockAddressResponse]((r, m) => _root_.fs2.Stream.eval(mkCtx(m)).flatMap(serviceImpl.getTxosByLockAddressStream(r, _))))
.addMethod(xyz.stratalab.indexer.services.TransactionServiceGrpc.METHOD_GET_TXOS_BY_ASSET_LABEL, _root_.fs2.grpc.server.Fs2ServerCallHandler[F](dispatcher, serverOptions).unaryToStreamingCall[xyz.stratalab.indexer.services.QueryByAssetLabelRequest, xyz.stratalab.indexer.services.TxoResponse]((r, m) => _root_.fs2.Stream.eval(mkCtx(m)).flatMap(serviceImpl.getTxosByAssetLabel(r, _))))
.addMethod(xyz.stratalab.indexer.services.TransactionServiceGrpc.METHOD_CREATE_ON_CHAIN_TRANSACTION_INDEX, _root_.fs2.grpc.server.Fs2ServerCallHandler[F](dispatcher, serverOptions).unaryToUnaryCall[xyz.stratalab.indexer.services.CreateOnChainTransactionIndexRequest, xyz.stratalab.indexer.services.CreateOnChainTransactionIndexResponse]((r, m) => mkCtx(m).flatMap(serviceImpl.createOnChainTransactionIndex(r, _))))
.addMethod(xyz.stratalab.indexer.services.TransactionServiceGrpc.METHOD_GET_EXISTING_TRANSACTION_INDEXES, _root_.fs2.grpc.server.Fs2ServerCallHandler[F](dispatcher, serverOptions).unaryToUnaryCall[xyz.stratalab.indexer.services.GetExistingTransactionIndexesRequest, xyz.stratalab.indexer.services.GetExistingTransactionIndexesResponse]((r, m) => mkCtx(m).flatMap(serviceImpl.getExistingTransactionIndexes(r, _))))
.addMethod(xyz.stratalab.indexer.services.TransactionServiceGrpc.METHOD_GET_INDEXED_TRANSACTIONS, _root_.fs2.grpc.server.Fs2ServerCallHandler[F](dispatcher, serverOptions).unaryToStreamingCall[xyz.stratalab.indexer.services.GetIndexedTransactionsRequest, xyz.stratalab.indexer.services.TransactionResponse]((r, m) => _root_.fs2.Stream.eval(mkCtx(m)).flatMap(serviceImpl.getIndexedTransactions(r, _))))
.addMethod(xyz.stratalab.indexer.services.TransactionServiceGrpc.METHOD_DROP_INDEX, _root_.fs2.grpc.server.Fs2ServerCallHandler[F](dispatcher, serverOptions).unaryToUnaryCall[xyz.stratalab.indexer.services.DropIndexRequest, xyz.stratalab.indexer.services.DropIndexResponse]((r, m) => mkCtx(m).flatMap(serviceImpl.dropIndex(r, _))))
.build()
}
}