syntax = "proto3";

package exchain.orderbook.v1;

option go_package = "github.com/exchain/go-exchain/exchain/protocol/orderbook/v1;orderbookv1";

import "nebula/v1/transaction.proto";
import "google/api/annotations.proto";


message PlaceLimitOrderRequest {
  exchain.nebula.v1.Transaction transaction = 1;
}

message PlaceMarketOrderRequest {
  exchain.nebula.v1.Transaction transaction = 1;
}

message CancelOrderRequest {
  exchain.nebula.v1.Transaction transaction = 1;
}

message SignProxyRequest {
  exchain.nebula.v1.Transaction transaction = 1;
}

message Response {
    bytes data = 1;
}

service Orderbook {
  rpc PlaceLimitOrder (PlaceLimitOrderRequest) returns (Response) {
    option (google.api.http) = {
        post: "/exchain/v1/orderbook/place_limit_order"
        body: "*"
    };
  }
  rpc PlaceMarketOrder (PlaceMarketOrderRequest) returns (Response) {
    option (google.api.http) = {
        post: "/exchain/v1/orderbook/place_market_order"
        body: "*"
    };
  }
  rpc CancelOrder (CancelOrderRequest) returns (Response) {
    option (google.api.http) = {
        post: "/exchain/v1/orderbook/cancel_order"
        body: "*"
    };
  }
  rpc SignProxy (SignProxyRequest) returns (Response) {
    option (google.api.http) = {
        post: "/exchain/v1/orderbook/sign_proxy"
        body: "*"
    };
  }
}

