Compare commits

..

No commits in common. "099b435e09de6005ee165b123891adb1416d7206" and "66931098a98861fe27921b5ea658df7038a96bd6" have entirely different histories.

2 changed files with 34 additions and 40 deletions

View File

@ -34,15 +34,15 @@ message CalcMarketReq {
int64 counter_asset_id = 3; int64 counter_asset_id = 3;
double amount = 4; double amount = 4;
double unit_price = 5; double unit_price = 5;
MarketParticipantType participant_type = 6; MarketParticipantType type = 6;
optional 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 { message CalcMarketRes {
double calculated_irt_amount = 1; double calculated_irt_amount = 1;
double calculated_asset_amount = 2; double calculated_asset_amount = 2;
wallet.v1.EffectiveCommission commission = 3; wallet.v1.EffectiveCommission commission = 3;
MarketParticipantType participant_type = 4; 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
} }
@ -59,18 +59,17 @@ message MarketOrder {
MarketOrderSide side = 8; MarketOrderSide side = 8;
MarketOrderStatus status = 9; MarketOrderStatus status = 9;
int64 from = 10; int64 from = 10;
MarketParticipantType participant_type = 11; auth.v1.UserIdentityBasic from_identity = 11;
auth.v1.UserIdentityBasic from_identity = 12; wallet.v1.Commission commission = 12;
wallet.v1.Commission commission = 13; double completed_amount = 13;
double completed_amount = 14; double available_amount = 14;
double available_amount = 15; string created_at = 15;
string created_at = 16; string updated_at = 16;
string updated_at = 17; bool is_public = 17;
bool is_public = 18; wallet.v1.TransactionList trx = 18;
wallet.v1.TransactionList trx = 19; repeated string tags = 19;
repeated string tags = 20; repeated string comment = 20;
repeated string comment = 21; optional MarketOrder source = 21; // purchase is done via this field
optional MarketOrder source = 22; // purchase is done via this field
// repeated string attachments = 14; // possible files included by // repeated string attachments = 14; // possible files included by
// seller/buyer // seller/buyer
} }
@ -118,12 +117,11 @@ message NewMarketReq {
int64 counter_asset_id = 3; int64 counter_asset_id = 3;
double amount = 4; double amount = 4;
double unit_price = 5; double unit_price = 5;
// TODO: Change name MarketParticipantType type = 6;
MarketParticipantType participant_type = 6; wallet.v1.BuyAssetSide req_side = 7; // For Calculation : can be from asset or irt
// For Calculation : can be from asset or irt
wallet.v1.BuyAssetSide req_side = 7;
MarketOrderSide side = 8; MarketOrderSide side = 8;
// TODO: maker market order as optional optional auth.v1.TFA tfa = 9;
optional bool accepted_contract = 10;
} }
enum MarketOrdersSortBy { enum MarketOrdersSortBy {
@ -147,7 +145,7 @@ message OrderListFilter {
repeated string to = 7; repeated string to = 7;
optional double starting_price = 8; optional double starting_price = 8;
optional double ending_price = 9; optional double ending_price = 9;
repeated uint64 asset = 10; repeated wallet.v1.Asset asset = 10;
optional uint64 order_id = 11; optional uint64 order_id = 11;
optional uint64 trx_id = 12; optional uint64 trx_id = 12;
optional bool is_public = 13; optional bool is_public = 13;
@ -163,11 +161,10 @@ message OrderListFilter {
/* Contract */ /* Contract */
message ContractMarketRes { message ContractMarketRes {
string link = 1; string link = 1;
uint64 asset_id = 2; uint64 agreement_id = 2;
uint64 agreement_id = 3; uint64 transaction_id = 3;
uint64 transaction_id = 4; string contract_hash = 4;
string contract_hash = 5; string contract_content = 5;
string contract_content = 6;
} }
message DeclineMarketContractReq { message DeclineMarketContractReq {
@ -175,16 +172,9 @@ message DeclineMarketContractReq {
uint64 agreement_id = 2; uint64 agreement_id = 2;
} }
message ConfirmMarketContractReq {
auth.v1.InternalIAM iam = 1;
uint64 agreement_id = 2;
optional auth.v1.TFA tfa = 3;
}
message MarketContractReq { message MarketContractReq {
auth.v1.InternalIAM iam = 1; auth.v1.InternalIAM iam = 1;
// uint64 asset_id = 2;
uint64 order_id = 2; // Maker OrderID uint64 order_id = 2; // Maker OrderID
// double amount = 4; double amount = 3;
// wallet.v1.BuyAssetSide req_side = 5; wallet.v1.BuyAssetSide req_side = 4;
} }

View File

@ -7,20 +7,24 @@ import "base/v1/msg.proto";
import "market/v1/msg.proto"; import "market/v1/msg.proto";
service MarketplaceSrv { service MarketplaceSrv {
rpc CalcMarketOrder(CalcMarketReq) returns (CalcMarketRes);
rpc MarketplaceSrvHealth(base.v1.Empty) returns (base.v1.StatusRes); rpc MarketplaceSrvHealth(base.v1.Empty) returns (base.v1.StatusRes);
rpc GetMarketPubHistory(OrderListFilter) returns (MarketOrderList); // This is for public market
rpc GetUserMarketHistory(OrderListFilter) returns (MarketOrderList); // list of order + purchase related to buying an asset
rpc GetMarketOrderDet(auth.v1.IdReqWithIAM) returns (MarketOrder); // details of an order by id rpc GetMarketOrderDet(auth.v1.IdReqWithIAM) returns (MarketOrder); // details of an order by id
rpc GetAllOrderList(OrderListFilter) returns (MarketOrderList); // list of all orders (seller and buyer combined) rpc GetAllOrderList(OrderListFilter) returns (MarketOrderList); // list of all orders (seller and buyer combined)
rpc GetMarketAssetList(MarketAssetListReq) returns (MarketAssetList); // assets that can be listed in marketplace rpc GetMarketAssetList(MarketAssetListReq) returns (MarketAssetList); // assets that can be listed in marketplace
rpc CalcMarketOrder(CalcMarketReq) returns (CalcMarketRes); rpc NewMarketOrder(NewMarketReq) returns (MarketOrder); // insert new buy order to market
rpc Purchase(PurchaseReq) returns (PurchaseRes); // purchase from an order
rpc CancelOrder(auth.v1.IdReqWithIAMAndTFA) returns (base.v1.StatusRes); // cancel an order rpc CancelOrder(auth.v1.IdReqWithIAMAndTFA) returns (base.v1.StatusRes); // cancel an order
rpc NewMarketOrder(NewMarketReq) returns (MarketOrder); // insert new buy order to market rpc GetMarketPubHistory(OrderListFilter) returns (MarketOrderList); // This is for public market
rpc GetUserMarketHistory(OrderListFilter) returns (MarketOrderList); // list of order + purchase related to buying an asset
// Contract
rpc GenerateMarketContract(MarketContractReq) returns (ContractMarketRes); rpc GenerateMarketContract(MarketContractReq) returns (ContractMarketRes);
rpc ConfirmMarketContract(ConfirmMarketContractReq) returns (base.v1.StatusRes);
} }