MarketPlace: new srv market added
Signed-off-by: nfel <nfilsaraee@gmail.com>
This commit is contained in:
parent
87ee504638
commit
cb9b5ac9f2
@ -5,7 +5,7 @@ package alert.v1;
|
||||
import "base/v1/msg.proto";
|
||||
|
||||
message AlertFilter {
|
||||
base.v1.Filter base_filter = 1;
|
||||
base.v1.BaseQueryParam base_filter = 1;
|
||||
Importance importance = 2;
|
||||
LogSource source = 3;
|
||||
}
|
||||
|
||||
@ -2,6 +2,8 @@ syntax = "proto3";
|
||||
|
||||
package auth.v1;
|
||||
|
||||
import "base/v1/msg.proto";
|
||||
|
||||
/*
|
||||
Internal
|
||||
*/
|
||||
@ -81,6 +83,13 @@ message IdReqWithIAM {
|
||||
int64 id = 1;
|
||||
InternalIAM iam = 2;
|
||||
}
|
||||
|
||||
// Used for endpoints that need token and Query Param
|
||||
message IAMWithQP {
|
||||
InternalIAM iam = 1;
|
||||
base.v1.BaseQueryParam qp = 2;
|
||||
}
|
||||
|
||||
message ReqWithIAMAndParams {
|
||||
InternalIAM iam = 1;
|
||||
optional bool accepted = 2;
|
||||
@ -230,6 +239,9 @@ enum TfaStateEnum {
|
||||
INTERNAL_TRANSFER = 2;
|
||||
EXTERNAL_TRANSFER = 3;
|
||||
REDEEM_TOKEN = 4;
|
||||
MARKET_PALCE_PURCHASE = 5;
|
||||
MARKET_PALCE_ORDER_CREATE = 6;
|
||||
MARKET_PALCE_ORDER_CANCEL = 7;
|
||||
}
|
||||
|
||||
message Recipient {
|
||||
|
||||
@ -18,8 +18,8 @@ message Pagination {
|
||||
uint32 page_size = 2; // in query param it will be pz
|
||||
optional uint32 total_count = 3; // reponse
|
||||
}
|
||||
message Filter {
|
||||
string query = 1; // q
|
||||
string sort = 2; // s
|
||||
|
||||
message BaseQueryParam {
|
||||
repeated string sort = 2; // sort by
|
||||
optional Pagination page = 3;
|
||||
}
|
||||
|
||||
101
market/v1/msg.proto
Normal file
101
market/v1/msg.proto
Normal file
@ -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;
|
||||
}
|
||||
24
market/v1/srv.proto
Normal file
24
market/v1/srv.proto
Normal file
@ -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);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user