v2: code formate + market support for calculation amount ( from taker/maker + seller/buyer )
Signed-off-by: nfel <nfilsaraee@gmail.com>
This commit is contained in:
+51
-23
@@ -9,7 +9,9 @@ import "base/v1/msg.proto";
|
||||
INTERNAL DATA
|
||||
*/
|
||||
|
||||
message InternalTransactionData { int64 transaction_id = 1; }
|
||||
message InternalTransactionData {
|
||||
int64 transaction_id = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
Federation
|
||||
@@ -107,8 +109,8 @@ message Asset {
|
||||
AssetPrice price = 35;
|
||||
bool is_base_asset = 36;
|
||||
bool is_locked = 37;
|
||||
Commission commission = 38;
|
||||
AssetType type = 39;
|
||||
// Commission commission = 38;
|
||||
AssetType type = 38;
|
||||
}
|
||||
|
||||
enum AssetTokenType {
|
||||
@@ -136,11 +138,13 @@ enum AssetType {
|
||||
ASSET_TYPE_NETWORK_GAS = 3;
|
||||
}
|
||||
|
||||
message AssetList { repeated Asset list = 1; }
|
||||
message AssetList {
|
||||
repeated Asset list = 1;
|
||||
}
|
||||
|
||||
message AssetFilter {
|
||||
repeated int64 ids = 1;
|
||||
repeated AssetType type = 2; // AssetType
|
||||
repeated AssetType type = 2; // AssetType
|
||||
repeated AssetType token_type = 3; // AssetType
|
||||
repeated AssetStatus status = 4;
|
||||
repeated string name = 5;
|
||||
@@ -166,8 +170,7 @@ 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;
|
||||
}
|
||||
|
||||
@@ -182,7 +185,9 @@ message GetAssetReq {
|
||||
optional string code = 3;
|
||||
}
|
||||
|
||||
message AssetMeta { PropertyMeta property = 1; }
|
||||
message AssetMeta {
|
||||
PropertyMeta property = 1;
|
||||
}
|
||||
|
||||
message PropertyMeta {
|
||||
string description = 1;
|
||||
@@ -199,12 +204,12 @@ message PropertyMeta {
|
||||
string location_image = 12;
|
||||
float lat = 13;
|
||||
float lng = 14;
|
||||
string map_link= 15;
|
||||
string map_link = 15;
|
||||
PropertyDetail detail = 16;
|
||||
}
|
||||
|
||||
message PropertyDetail {
|
||||
repeated Content badge = 1; // 2>
|
||||
repeated Content badge = 1; // 2>
|
||||
repeated Content content = 2; // 4>
|
||||
}
|
||||
|
||||
@@ -281,8 +286,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;
|
||||
}
|
||||
|
||||
@@ -306,7 +310,9 @@ message BNPLInfo {
|
||||
string expires_at = 14;
|
||||
}
|
||||
|
||||
message BNPLList { repeated BNPLInfo list = 1; }
|
||||
message BNPLList {
|
||||
repeated BNPLInfo list = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
Transaction
|
||||
@@ -446,7 +452,9 @@ message RedeemTokenRes {
|
||||
optional auth.v1.BankInfo bank_info = 10;
|
||||
optional string receipt = 11;
|
||||
}
|
||||
message RedeemTokenResList { repeated RedeemTokenRes list = 1; }
|
||||
message RedeemTokenResList {
|
||||
repeated RedeemTokenRes list = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
Utility: Get Public Key from national id
|
||||
@@ -457,7 +465,9 @@ message NationalIDReq {
|
||||
string national_id = 2;
|
||||
}
|
||||
|
||||
message PubKeyRes { string pub_key = 1; }
|
||||
message PubKeyRes {
|
||||
string pub_key = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
Network Details
|
||||
@@ -483,11 +493,22 @@ message Network {
|
||||
string created_at = 11;
|
||||
}
|
||||
|
||||
message NetworkList { repeated Network list = 1; }
|
||||
message NetworkList {
|
||||
repeated Network list = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Commission
|
||||
* */
|
||||
|
||||
enum CommissionType {
|
||||
COMMISSION_TYPE_ICO = 0;
|
||||
COMMISSION_TYPE_MARKET_MAKER = 1;
|
||||
COMMISSION_TYPE_MARKET_TAKER = 2;
|
||||
COMMISSION_TYPE_BNPL = 3;
|
||||
COMMISSION_TYPE_REDEEM = 4;
|
||||
}
|
||||
|
||||
message Commission {
|
||||
uint64 id = 1;
|
||||
string name = 2;
|
||||
@@ -495,10 +516,16 @@ message Commission {
|
||||
double service_percentage = 4;
|
||||
double tax_static = 5;
|
||||
double tax_percentage = 6;
|
||||
optional string collector = 7;
|
||||
optional string description = 8;
|
||||
string updated_at = 9;
|
||||
string created_at = 10;
|
||||
Asset asset = 7;
|
||||
CommissionType type = 8;
|
||||
optional string collector = 9;
|
||||
optional string description = 10;
|
||||
string updated_at = 11;
|
||||
string created_at = 12;
|
||||
}
|
||||
|
||||
message CommissionList {
|
||||
repeated Commission list = 1;
|
||||
}
|
||||
|
||||
message EffectiveCommission {
|
||||
@@ -555,7 +582,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;
|
||||
@@ -604,7 +633,7 @@ message DeclineBuyContractReq {
|
||||
|
||||
message ConfirmBuyAssetReq {
|
||||
auth.v1.InternalIAM iam = 1;
|
||||
uint64 agreement_id = 2; // Only in asset that require agreement contract
|
||||
uint64 agreement_id = 2; // Only in asset that require agreement contract
|
||||
optional auth.v1.TFA tfa = 3; // This might be used in the future
|
||||
}
|
||||
|
||||
@@ -628,7 +657,6 @@ message BuyAssetRes {
|
||||
}
|
||||
|
||||
/* Contract */
|
||||
|
||||
enum ContractType {
|
||||
CONTRACT_TYPE_ICO = 0;
|
||||
CONTRACT_TYPE_MARKET = 1;
|
||||
|
||||
@@ -21,6 +21,7 @@ service WalletService {
|
||||
// rpc UserGetAssetList(auth.v1.InternalIAM) returns (AssetList);
|
||||
// rpc AdminGetAssetList(base.v1.Empty) returns (AssetList);
|
||||
rpc GetAsset(GetAssetReq) returns (Asset);
|
||||
rpc GetAssetCommissions(base.v1.IdReq) returns (CommissionList);
|
||||
rpc GetAssetPrice(base.v1.IdReq) returns (AssetPrice);
|
||||
|
||||
rpc UserInitWallet(UserInitWalletReq) returns (base.v1.StatusRes);
|
||||
|
||||
Reference in New Issue
Block a user