Market Contract proto changes #27

Merged
nfel merged 9 commits from market/contract into v2 2025-08-02 13:59:09 +00:00
2 changed files with 40 additions and 34 deletions

View File

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

View File

@ -7,24 +7,20 @@ import "base/v1/msg.proto";
import "market/v1/msg.proto";
service MarketplaceSrv {
rpc CalcMarketOrder(CalcMarketReq) returns (CalcMarketRes);
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 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 NewMarketOrder(NewMarketReq) returns (MarketOrder); // insert new buy order to market
rpc Purchase(PurchaseReq) returns (PurchaseRes); // purchase from an order
rpc CalcMarketOrder(CalcMarketReq) returns (CalcMarketRes);
rpc CancelOrder(auth.v1.IdReqWithIAMAndTFA) returns (base.v1.StatusRes); // cancel an order
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 NewMarketOrder(NewMarketReq) returns (MarketOrder); // insert new buy order to market
rpc GenerateMarketContract(MarketContractReq) returns (ContractMarketRes);
rpc ConfirmMarketContract(ConfirmMarketContractReq) returns (base.v1.StatusRes);
}