Compare commits

...

10 Commits

2 changed files with 40 additions and 34 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 type = 6; MarketParticipantType participant_type = 6;
wallet.v1.BuyAssetSide req_side = 7; // For Calculation : can be from asset or irt optional 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 type = 4; MarketParticipantType participant_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,17 +59,18 @@ message MarketOrder {
MarketOrderSide side = 8; MarketOrderSide side = 8;
MarketOrderStatus status = 9; MarketOrderStatus status = 9;
int64 from = 10; int64 from = 10;
auth.v1.UserIdentityBasic from_identity = 11; MarketParticipantType participant_type = 11;
wallet.v1.Commission commission = 12; auth.v1.UserIdentityBasic from_identity = 12;
double completed_amount = 13; wallet.v1.Commission commission = 13;
double available_amount = 14; double completed_amount = 14;
string created_at = 15; double available_amount = 15;
string updated_at = 16; string created_at = 16;
bool is_public = 17; string updated_at = 17;
wallet.v1.TransactionList trx = 18; bool is_public = 18;
repeated string tags = 19; wallet.v1.TransactionList trx = 19;
repeated string comment = 20; repeated string tags = 20;
optional MarketOrder source = 21; // purchase is done via this field repeated string comment = 21;
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
} }
@ -117,11 +118,12 @@ 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;
MarketParticipantType type = 6; // TODO: Change name
wallet.v1.BuyAssetSide req_side = 7; // For Calculation : can be from asset or irt MarketParticipantType participant_type = 6;
// For Calculation : can be from asset or irt
wallet.v1.BuyAssetSide req_side = 7;
MarketOrderSide side = 8; MarketOrderSide side = 8;
optional auth.v1.TFA tfa = 9; // TODO: maker market order as optional
optional bool accepted_contract = 10;
} }
enum MarketOrdersSortBy { enum MarketOrdersSortBy {
@ -145,7 +147,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 wallet.v1.Asset asset = 10; repeated uint64 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;
@ -161,10 +163,11 @@ message OrderListFilter {
/* Contract */ /* Contract */
message ContractMarketRes { message ContractMarketRes {
string link = 1; string link = 1;
uint64 agreement_id = 2; uint64 asset_id = 2;
uint64 transaction_id = 3; uint64 agreement_id = 3;
string contract_hash = 4; uint64 transaction_id = 4;
string contract_content = 5; string contract_hash = 5;
string contract_content = 6;
} }
message DeclineMarketContractReq { message DeclineMarketContractReq {
@ -172,9 +175,16 @@ 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 = 3; // double amount = 4;
wallet.v1.BuyAssetSide req_side = 4; // wallet.v1.BuyAssetSide req_side = 5;
} }

View File

@ -7,24 +7,20 @@ 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 NewMarketOrder(NewMarketReq) returns (MarketOrder); // insert new buy order to market rpc CalcMarketOrder(CalcMarketReq) returns (CalcMarketRes);
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 GetMarketPubHistory(OrderListFilter) returns (MarketOrderList); // This is for public market rpc NewMarketOrder(NewMarketReq) returns (MarketOrder); // insert new buy order to 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);
} }