MarketPlace: new srv market added
Signed-off-by: nfel <nfilsaraee@gmail.com>
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package market.v1;
|
||||
|
||||
import "auth/v1/msg.proto";
|
||||
import "base/v1/msg.proto";
|
||||
import "wallet/v1/msg.proto";
|
||||
|
||||
message MPHistoryFilter {}
|
||||
message MPListFilter {}
|
||||
message MarketOrder {
|
||||
uint64 id = 1;
|
||||
uint64 trx_id = 2;
|
||||
wallet.v1.Asset asset = 3;
|
||||
wallet.v1.Asset counter_asset = 4;
|
||||
double amount = 5;
|
||||
double unit_price = 6;
|
||||
double total_price = 7;
|
||||
MarketOrderType type = 8;
|
||||
MarketOrderStatus status = 9;
|
||||
string from = 10;
|
||||
float commission = 11;
|
||||
float completion_rate = 12;
|
||||
string created_at = 13;
|
||||
string updated_at = 14;
|
||||
bool is_public = 15;
|
||||
wallet.v1.TransactionList trx = 16;
|
||||
repeated string tags = 17;
|
||||
repeated string comment = 18;
|
||||
// repeated string attachments = 14; // possible files included by seller/buyer
|
||||
}
|
||||
|
||||
message PurchaseReq {
|
||||
uint64 order_id = 1;
|
||||
double amount = 2;
|
||||
bool accepted_contract = 3;
|
||||
auth.v1.TFA tfa = 4;
|
||||
}
|
||||
message PurchaseRes {
|
||||
uint64 order_id = 1;
|
||||
uint64 trx_id = 2;
|
||||
double calculated_amount = 3;
|
||||
MarketOrderStatus status = 4;
|
||||
}
|
||||
|
||||
message MarketOrderList {
|
||||
repeated MarketOrder list = 1;
|
||||
}
|
||||
|
||||
message Buyer {}
|
||||
message Seller {}
|
||||
message CancleOrderReq{
|
||||
uint64 order_id = 1;
|
||||
}
|
||||
message NewMarketRes{
|
||||
uint64 order_id = 1;
|
||||
wallet.v1.Asset asset = 2;
|
||||
double amount = 3;
|
||||
double unit_price = 4;
|
||||
}
|
||||
message NewMarketReq{
|
||||
auth.v1.InternalIAM iam = 1;
|
||||
wallet.v1.Asset asset = 2;
|
||||
double amount = 3;
|
||||
double unit_price = 4;
|
||||
auth.v1.TFA tfa = 5;
|
||||
bool accepted_contract = 6;
|
||||
}
|
||||
|
||||
enum MarketOrderType {
|
||||
MO_UNKOWN = 0;
|
||||
MO_BUY = 1;
|
||||
MO_SELL = 2;
|
||||
}
|
||||
enum MarketOrderStatus {
|
||||
MO_UNKOWN_MP_STATUS = 0; // Unknown
|
||||
MO_OPEN = 1; // Order is open and waiting to be completed
|
||||
MO_CANCEL = 2; // Cancelled by user
|
||||
MO_COMPLETED = 3; // Order is completed
|
||||
MO_FAILED = 4; // Order is failed - bad trx , etc.
|
||||
MO_REFUNDED = 5; // Order is refunded by platform to user due to regulation
|
||||
// MO_EXPIRED = 4; // Order is expired
|
||||
}
|
||||
message OrderListFilter {
|
||||
base.v1.BaseQueryParam base = 2;
|
||||
optional string search = 3;
|
||||
repeated MarketOrderType type = 4;
|
||||
repeated MarketOrderStatus status = 5;
|
||||
repeated string from = 6;
|
||||
repeated string to = 7;
|
||||
optional double starting_price = 8;
|
||||
optional double ending_price = 9;
|
||||
repeated wallet.v1.Asset asset = 10;
|
||||
uint64 order_id = 11;
|
||||
uint64 trx_id = 12;
|
||||
}
|
||||
|
||||
message OrderListFilterWithIAM {
|
||||
OrderListFilter filter = 1;
|
||||
auth.v1.InternalIAM iam = 2;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package market.v1;
|
||||
|
||||
import "base/v1/msg.proto";
|
||||
import "market/v1/msg.proto";
|
||||
|
||||
service MarketplaceSrv {
|
||||
rpc GetSellerList(OrderListFilter) returns (MarketOrderList);
|
||||
rpc GetBuyerList(OrderListFilter) returns (MarketOrderList);
|
||||
rpc GetAllOrderList(OrderListFilter) returns (MarketOrderList);
|
||||
|
||||
rpc GetMarketHistory(OrderListFilter) returns (MarketOrderList); // This is for public market
|
||||
|
||||
rpc Purchace(PurchaseReq) returns (PurchaseRes);
|
||||
|
||||
rpc NewSellOrder(NewMarketReq) returns (NewMarketRes);
|
||||
rpc NewBuyOrder(NewMarketReq) returns (NewMarketRes);
|
||||
|
||||
rpc CancleOrder(CancleOrderReq) returns (base.v1.StatusRes);
|
||||
|
||||
rpc GetBuyHistory(OrderListFilterWithIAM) returns (MarketOrderList);
|
||||
rpc GetSellHistory(OrderListFilterWithIAM) returns (MarketOrderList);
|
||||
}
|
||||
Reference in New Issue
Block a user