Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fdd3b42e51 | |||
| 503bfec668 | |||
|
f9ef69113a
|
|||
| 4154200991 | |||
| 7a886e094e | |||
|
488d624a52
|
|||
|
dc7e4d244b
|
|||
|
e5886d2e86
|
|||
| b133fd5fed | |||
|
523093779a
|
|||
| 4f25639e98 | |||
| 39afba396d | |||
| 4a24fcb263 | |||
|
9e3c4b9ff0
|
|||
|
8c2305b8bd
|
|||
|
fe71cb20dd
|
|||
|
a2adce3670
|
|||
|
a3c15365f2
|
|||
| 099b435e09 | |||
| 0153e8a176 | |||
|
922a000214
|
|||
| df1df24852 | |||
| 431c98d9ca | |||
|
d822e8bfa7
|
|||
| fa218436a6 | |||
|
66931098a9
|
|||
| 1c6d3f3f01 | |||
| 30bec96010 | |||
| 68ade9b3af | |||
| 780638c2c6 | |||
| a19bcd544c | |||
| 219b388648 | |||
| cbc7524120 | |||
| f5a99c7adf | |||
| 4f269b9564 | |||
| 8ab8d8d0f9 | |||
| c102ca4055 | |||
| 61fe3a6f5d |
+2
-2
@@ -266,8 +266,8 @@ enum TfaStateEnum {
|
||||
INTERNAL_TRANSFER = 2;
|
||||
EXTERNAL_TRANSFER = 3;
|
||||
REDEEM_TOKEN = 4;
|
||||
MARKET_PLACE_PURCHASE = 5;
|
||||
MARKET_PLACE_ORDER_CREATE = 6;
|
||||
MARKET_PLACE_MAKER = 5;
|
||||
MARKET_PLACE_TAKER = 6;
|
||||
MARKET_PLACE_ORDER_CANCEL = 7;
|
||||
IRT_WITHDRAWAL = 8;
|
||||
IRT_DEPOSIT = 9;
|
||||
|
||||
+2
-1
@@ -83,6 +83,7 @@ enum ErrCode {
|
||||
MARKET_ORDER_CANCELED = 7023;
|
||||
MARKET_ORDER_FAILED = 7024;
|
||||
MARKET_ORDER_UNKNOWN = 7025;
|
||||
MARKET_ORDER_UNSUPPORTED_PARTICIPANT_TYPE = 7045;
|
||||
ASSET_CAN_NOT_BUY = 7026;
|
||||
ASSET_BUY_PRICE_IS_ZERO = 7019;
|
||||
MARKET_ORDER_MATCHING_ERR_REFUND = 7128;
|
||||
@@ -102,6 +103,7 @@ enum ErrCode {
|
||||
LOW_REQUEST_AMOUNT = 7014;
|
||||
AGREEMENT_ALREADY_ACCEPTED = 7015;
|
||||
CONTRACT_ALREADY_GENERATED = 7016;
|
||||
CONTRACT_NOT_FOUND = 7080; // FIXME: Err numb er should be changed
|
||||
NIL_AUTH = 7017;
|
||||
CAN_NOT_BUY_AND_DEPOSIT = 7018;
|
||||
WHITELIST_ALREADY_USED = 7027;
|
||||
@@ -114,7 +116,6 @@ enum ErrCode {
|
||||
NOT_ENOUGH_LOCKED_BALANCE = 7034;
|
||||
NOT_ENOUGH_BALANCE_TO_LOCK = 7035;
|
||||
|
||||
|
||||
// Server errors
|
||||
SERVER_ERROR_FREEZED_BALANCE_NEGATIVE = 8000;
|
||||
SERVER_ERROR_NIL_DB_TX = 8001;
|
||||
|
||||
+66
-34
@@ -34,18 +34,16 @@ 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;
|
||||
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;
|
||||
wallet.v1.BuyAssetSide req_side =
|
||||
5; // For Calculation : can be from asset or irt
|
||||
MarketParticipantType participant_type = 4;
|
||||
wallet.v1.BuyAssetSide req_side = 5; // For Calculation : can be from asset or irt
|
||||
}
|
||||
|
||||
message MPHistoryFilter {}
|
||||
@@ -61,24 +59,24 @@ 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
|
||||
}
|
||||
|
||||
message MarketAssetListReq {
|
||||
optional auth.v1.InternalIAM iam =
|
||||
1; // If not set, will returns only public orders which are limited by a
|
||||
optional auth.v1.InternalIAM iam = 1; // If not set, will returns only public orders which are limited by a
|
||||
optional uint32 page_no = 2;
|
||||
optional uint32 page_size = 3;
|
||||
}
|
||||
@@ -90,17 +88,16 @@ message MarketAssetList {
|
||||
uint32 total_count = 4;
|
||||
}
|
||||
|
||||
message PurchaseReq {
|
||||
message MatchOrderReq {
|
||||
auth.v1.InternalIAM iam = 1;
|
||||
uint64 order_id = 2;
|
||||
double amount = 3;
|
||||
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
|
||||
optional bool accepted_contract = 4;
|
||||
optional auth.v1.TFA tfa = 5;
|
||||
}
|
||||
|
||||
message PurchaseRes {
|
||||
message MatchOrderRes {
|
||||
uint64 order_id = 1;
|
||||
double calculated_irt_amount = 2;
|
||||
double calculated_asset_amount = 3;
|
||||
@@ -115,18 +112,24 @@ message MarketOrderList {
|
||||
uint32 total_count = 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* participant_type: IS Maker/Taker
|
||||
* side: IS Buying/Selling
|
||||
* req_side: IS input (amount) in irt/asset
|
||||
* */
|
||||
message NewMarketReq {
|
||||
auth.v1.InternalIAM iam = 1;
|
||||
int64 asset_id = 2;
|
||||
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
|
||||
optional uint64 maker_order_id = 9;
|
||||
}
|
||||
|
||||
enum MarketOrdersSortBy {
|
||||
@@ -150,15 +153,44 @@ 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;
|
||||
optional bool has_source = 14;
|
||||
optional uint64 source_order_id = 15;
|
||||
optional uint64 maker_order_id = 15;
|
||||
optional string from_date = 16;
|
||||
optional string to_date = 17;
|
||||
optional MarketOrdersSortBy sort_by = 18;
|
||||
optional uint32 page_no = 19;
|
||||
optional uint32 page_size = 20;
|
||||
optional MarketParticipantType participant_type = 18;
|
||||
optional MarketOrdersSortBy sort_by = 19;
|
||||
optional uint32 page_no = 21;
|
||||
optional uint32 page_size = 22;
|
||||
}
|
||||
|
||||
/* Contract */
|
||||
message ContractMarketRes {
|
||||
string link = 1;
|
||||
uint64 asset_id = 2;
|
||||
uint64 agreement_id = 3;
|
||||
uint64 transaction_id = 4;
|
||||
string contract_hash = 5;
|
||||
string contract_content = 6;
|
||||
}
|
||||
|
||||
message DeclineMarketContractReq {
|
||||
auth.v1.InternalIAM iam = 1;
|
||||
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 = 4;
|
||||
// wallet.v1.BuyAssetSide req_side = 5;
|
||||
}
|
||||
|
||||
+12
-13
@@ -7,21 +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 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 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
|
||||
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 CalcMarketOrder(CalcMarketReq) returns (CalcMarketRes);
|
||||
|
||||
rpc CancelOrder(auth.v1.IdReqWithIAMAndTFA) returns (base.v1.StatusRes); // cancel an order
|
||||
|
||||
rpc NewMarketOrder(NewMarketReq) returns (MarketOrder); // insert new buy order to market
|
||||
rpc GenerateMarketContract(MarketContractReq) returns (ContractMarketRes);
|
||||
rpc ConfirmMarketContract(ConfirmMarketContractReq) returns (base.v1.StatusRes);
|
||||
rpc DeclineMarketContract(DeclineMarketContractReq) returns (base.v1.StatusRes);
|
||||
}
|
||||
|
||||
+26
-18
@@ -9,7 +9,9 @@ import "base/v1/msg.proto";
|
||||
INTERNAL DATA
|
||||
*/
|
||||
|
||||
message InternalTransactionData { int64 transaction_id = 1; }
|
||||
message InternalTransactionData {
|
||||
int64 transaction_id = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
Federation
|
||||
@@ -99,7 +101,7 @@ message Asset {
|
||||
string image = 8;
|
||||
string description = 9;
|
||||
string url = 10;
|
||||
int64 buy_unit_price = 11;
|
||||
// int64 buy_unit_price = 11;
|
||||
double buy_min_amount = 12;
|
||||
double buy_max_amount = 13;
|
||||
bool is_active = 20;
|
||||
@@ -163,8 +165,9 @@ message AssetFilter {
|
||||
optional bool can_sell = 7;
|
||||
optional bool can_deposit = 8;
|
||||
optional bool can_withdraw = 9;
|
||||
optional bool is_active = 10;
|
||||
optional string search = 11; // Not yet implemented !
|
||||
optional bool can_trade = 10;
|
||||
optional bool is_active = 11;
|
||||
optional string search = 12; // Not yet implemented !
|
||||
}
|
||||
|
||||
message AssetDiscountReq {
|
||||
@@ -181,15 +184,14 @@ message AssetDiscountRes {
|
||||
double static_amount = 4;
|
||||
double percentage = 5;
|
||||
double max_amount = 6;
|
||||
double effective_amount =
|
||||
7; // based of asset price and discount amount in req
|
||||
double effective_amount = 7; // based of asset price and discount amount in req
|
||||
optional int64 supported_asset = 8;
|
||||
}
|
||||
|
||||
message AssetPrice {
|
||||
string updated_at = 1;
|
||||
double market_price = 2;
|
||||
double platform_price = 3;
|
||||
double ico_price = 3;
|
||||
}
|
||||
|
||||
message GetAssetReq {
|
||||
@@ -197,7 +199,9 @@ message GetAssetReq {
|
||||
optional string code = 3;
|
||||
}
|
||||
|
||||
message AssetMeta { PropertyMeta property = 1; }
|
||||
message AssetMeta {
|
||||
PropertyMeta property = 1;
|
||||
}
|
||||
|
||||
message PropertyMeta {
|
||||
string description = 1;
|
||||
@@ -211,11 +215,10 @@ message PropertyMeta {
|
||||
string usage_type = 9;
|
||||
string completion_date = 10;
|
||||
string user_agreement_url = 11;
|
||||
string location_image = 12;
|
||||
float lat = 13;
|
||||
float lng = 14;
|
||||
string map_link = 15;
|
||||
PropertyDetail detail = 16;
|
||||
float lat = 12;
|
||||
float lng = 13;
|
||||
string map_link = 14;
|
||||
PropertyDetail detail = 15;
|
||||
}
|
||||
|
||||
message PropertyDetail {
|
||||
@@ -292,8 +295,7 @@ message UserBNPLReq {
|
||||
optional float amount = 7;
|
||||
optional PaymentPeriodInfo payment_period = 8;
|
||||
optional bool has_agreed_contract = 9;
|
||||
optional int32 current_step =
|
||||
10; // Can be useful for admin to change the current step
|
||||
optional int32 current_step = 10; // Can be useful for admin to change the current step
|
||||
optional int64 asset_id = 11;
|
||||
}
|
||||
|
||||
@@ -481,7 +483,9 @@ message NationalIDReq {
|
||||
string national_id = 2;
|
||||
}
|
||||
|
||||
message PubKeyRes { string pub_key = 1; }
|
||||
message PubKeyRes {
|
||||
string pub_key = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
Network Details
|
||||
@@ -609,7 +613,9 @@ message IPGConfirmReq {
|
||||
string final_amount = 7;
|
||||
}
|
||||
|
||||
message IPGConfirmRes { string receipt_link = 1; }
|
||||
message IPGConfirmRes {
|
||||
string receipt_link = 1;
|
||||
}
|
||||
|
||||
message SaleManualReq {
|
||||
auth.v1.InternalIAM iam = 1;
|
||||
@@ -684,9 +690,11 @@ message BuyAssetRes {
|
||||
/* Contract */
|
||||
enum ContractType {
|
||||
CONTRACT_TYPE_ICO = 0;
|
||||
CONTRACT_TYPE_MARKET = 1;
|
||||
CONTRACT_TYPE_MARKET = 1; //FIXME: Please remove this :)
|
||||
CONTRACT_TYPE_BNPL = 2;
|
||||
CONTRACT_TYPE_REDEEM = 3;
|
||||
CONTRACT_TYPE_MARKET_MAKER = 4;
|
||||
CONTRACT_TYPE_MARKET_TAKER = 5;
|
||||
}
|
||||
|
||||
// agreement_id
|
||||
|
||||
Reference in New Issue
Block a user