feat: add market contract rpc

This commit is contained in:
AmirMahdi Qiasvand 2025-07-29 11:56:51 +03:30
parent 4f269b9564
commit f5a99c7adf
2 changed files with 21 additions and 15 deletions

View File

@ -35,8 +35,7 @@ message CalcMarketReq {
double amount = 4; double amount = 4;
double unit_price = 5; double unit_price = 5;
MarketParticipantType type = 6; MarketParticipantType type = 6;
wallet.v1.BuyAssetSide req_side = wallet.v1.BuyAssetSide req_side = 7; // For Calculation : can be from asset or irt
7; // For Calculation : can be from asset or irt
} }
message CalcMarketRes { message CalcMarketRes {
@ -44,8 +43,7 @@ message CalcMarketRes {
double calculated_asset_amount = 2; double calculated_asset_amount = 2;
wallet.v1.EffectiveCommission commission = 3; wallet.v1.EffectiveCommission commission = 3;
MarketParticipantType type = 4; MarketParticipantType type = 4;
wallet.v1.BuyAssetSide req_side = wallet.v1.BuyAssetSide req_side = 5; // For Calculation : can be from asset or irt
5; // For Calculation : can be from asset or irt
} }
message MPHistoryFilter {} message MPHistoryFilter {}
@ -77,8 +75,7 @@ message MarketOrder {
} }
message MarketAssetListReq { message MarketAssetListReq {
optional auth.v1.InternalIAM iam = optional auth.v1.InternalIAM iam = 1; // If not set, will returns only public orders which are limited by a
1; // If not set, will returns only public orders which are limited by a
optional uint32 page_no = 2; optional uint32 page_no = 2;
optional uint32 page_size = 3; optional uint32 page_size = 3;
} }
@ -94,8 +91,7 @@ message PurchaseReq {
auth.v1.InternalIAM iam = 1; auth.v1.InternalIAM iam = 1;
uint64 order_id = 2; uint64 order_id = 2;
double amount = 3; double amount = 3;
wallet.v1.BuyAssetSide req_side = wallet.v1.BuyAssetSide req_side = 7; // For Calculation : can be from asset or irt
7; // For Calculation : can be from asset or irt
optional bool accepted_contract = 4; optional bool accepted_contract = 4;
optional auth.v1.TFA tfa = 5; optional auth.v1.TFA tfa = 5;
} }
@ -122,8 +118,7 @@ message NewMarketReq {
double amount = 4; double amount = 4;
double unit_price = 5; double unit_price = 5;
MarketParticipantType type = 6; MarketParticipantType type = 6;
wallet.v1.BuyAssetSide req_side = wallet.v1.BuyAssetSide req_side = 7; // For Calculation : can be from asset or irt
7; // For Calculation : can be from asset or irt
MarketOrderSide side = 8; MarketOrderSide side = 8;
optional auth.v1.TFA tfa = 9; optional auth.v1.TFA tfa = 9;
optional bool accepted_contract = 10; optional bool accepted_contract = 10;
@ -162,3 +157,11 @@ message OrderListFilter {
optional uint32 page_no = 19; optional uint32 page_no = 19;
optional uint32 page_size = 20; optional uint32 page_size = 20;
} }
message ContractMarketRes {
string link = 1;
uint64 agreement_id = 2;
uint64 transaction_id = 3;
string contract_hash = 4;
string contract_content = 5;
}

View File

@ -24,4 +24,7 @@ service MarketplaceSrv {
rpc GetMarketPubHistory(OrderListFilter) returns (MarketOrderList); // This is for public 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 rpc GetUserMarketHistory(OrderListFilter) returns (MarketOrderList); // list of order + purchase related to buying an asset
// Contract
rpc GenerateMarketContract(CalcMarketReq) returns (ContractMarketRes);
} }