Requests with list as their response now accept

page_no, page_size
Responses with list now have
page_no, page_size, optional total_count
This commit is contained in:
2025-07-16 15:53:24 +03:30
parent 3eac30a1e3
commit c5baf25a24
5 changed files with 93 additions and 73 deletions
+23 -21
View File
@@ -3,7 +3,6 @@ syntax = "proto3";
package market.v1;
import "auth/v1/msg.proto";
import "base/v1/msg.proto";
import "wallet/v1/msg.proto";
enum MarketParticipantType {
@@ -20,11 +19,11 @@ enum MarketOrderSide {
enum MarketOrderStatus {
MO_UNKNOWN_MP_STATUS = 0; // Unknown
MO_CREATED = 1; // Order is just created and awaits confirmation
MO_OPEN = 2; // Order is open and waiting to be completed
MO_CANCEL = 3; // Cancelled by user
MO_COMPLETED = 4; // Order is completed
MO_FAILED = 5; // Order is failed - bad trx , etc.
MO_CREATED = 1; // Order is just created and awaits confirmation
MO_OPEN = 2; // Order is open and waiting to be completed
MO_CANCEL = 3; // Cancelled by user
MO_COMPLETED = 4; // Order is completed
MO_FAILED = 5; // Order is failed - bad trx , etc.
MO_REFUNDED = 6; // Order is refunded by platform to user due to regulation
// MO_EXPIRED = 7; // Order is expired
}
@@ -36,8 +35,7 @@ message CalcMarketReq {
double amount = 4;
double unit_price = 5;
MarketParticipantType type = 6;
wallet.v1.BuyAssetSide req_side =
7; // For Calculation : can be from asset or irt
wallet.v1.BuyAssetSide req_side = 7; // For Calculation : can be from asset or irt
}
message CalcMarketRes {
@@ -45,8 +43,7 @@ message CalcMarketRes {
double calculated_asset_amount = 2;
wallet.v1.EffectiveCommission commission = 3;
MarketParticipantType type = 4;
wallet.v1.BuyAssetSide req_side =
5; // For Calculation : can be from asset or irt
wallet.v1.BuyAssetSide req_side = 5; // For Calculation : can be from asset or irt
}
message MPHistoryFilter {}
@@ -78,20 +75,23 @@ message MarketOrder {
}
message MarketAssetListReq {
base.v1.BaseQueryParam base = 1;
optional auth.v1.InternalIAM iam =
2; // If not set, will returns only public orders which are limited by a
// white list
optional auth.v1.InternalIAM iam = 1; // If not set, will returns only public orders which are limited by a
optional uint32 page_no = 2;
optional uint32 page_size = 3;
}
message MarketAssetList { repeated wallet.v1.Asset list = 1; }
message MarketAssetList {
repeated wallet.v1.Asset list = 1;
uint32 page_no = 2;
uint32 page_size = 3;
optional uint32 total_count = 4;
}
message PurchaseReq {
auth.v1.InternalIAM iam = 1;
uint64 order_id = 2;
double amount = 3;
wallet.v1.BuyAssetSide req_side =
7; // For Calculation : can be from asset or irt
wallet.v1.BuyAssetSide req_side = 7; // For Calculation : can be from asset or irt
optional bool accepted_contract = 4;
optional auth.v1.TFA tfa = 5;
}
@@ -105,8 +105,10 @@ message PurchaseRes {
}
message MarketOrderList {
base.v1.PaginationResp page = 2;
repeated MarketOrder list = 1;
uint32 page_no = 2;
uint32 page_size = 3;
optional uint32 total_count = 4;
}
message NewMarketReq {
@@ -116,8 +118,7 @@ message NewMarketReq {
double amount = 4;
double unit_price = 5;
MarketParticipantType type = 6;
wallet.v1.BuyAssetSide req_side =
7; // For Calculation : can be from asset or irt
wallet.v1.BuyAssetSide req_side = 7; // For Calculation : can be from asset or irt
MarketOrderSide side = 8;
optional auth.v1.TFA tfa = 9;
optional bool accepted_contract = 10;
@@ -137,7 +138,6 @@ enum MarketOrdersSortBy {
message OrderListFilter {
optional auth.v1.InternalIAM iam = 1;
base.v1.BaseQueryParam base = 2;
optional string search = 3;
optional MarketOrderSide side = 4;
repeated MarketOrderStatus status = 5;
@@ -154,4 +154,6 @@ message OrderListFilter {
optional string from_date = 16;
optional string to_date = 17;
optional MarketOrdersSortBy sort_by = 18;
optional uint32 page_no = 19;
optional uint32 page_size = 20;
}