101 lines
2.5 KiB
Protocol Buffer
101 lines
2.5 KiB
Protocol Buffer
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;
|
|
MarketOrderSide side = 8;
|
|
MarketOrderStatus status = 9;
|
|
int64 from = 10;
|
|
wallet.v1.Commission commission = 11;
|
|
float completed_amount = 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;
|
|
optional MarketOrder source = 19; // purchase is done via this field
|
|
// repeated string attachments = 14; // possible files included by seller/buyer
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
message MarketAssetList{
|
|
repeated wallet.v1.Asset list = 1;
|
|
}
|
|
|
|
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 {
|
|
base.v1.PaginationResp page = 2;
|
|
repeated MarketOrder list = 1;
|
|
}
|
|
|
|
message NewMarketReq{
|
|
auth.v1.InternalIAM iam = 1;
|
|
wallet.v1.Asset asset = 2;
|
|
double amount = 3;
|
|
double unit_price = 4;
|
|
MarketOrderSide side = 5;
|
|
auth.v1.TFA tfa = 6;
|
|
bool accepted_contract = 7;
|
|
}
|
|
|
|
enum MarketOrderSide {
|
|
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 {
|
|
optional auth.v1.InternalIAM iam = 1;
|
|
base.v1.BaseQueryParam base = 2;
|
|
optional string search = 3;
|
|
repeated MarketOrderSide side = 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;
|
|
}
|
|
|