Compare commits

..

23 Commits

Author SHA1 Message Date
mapoofano 33474ccaba chore: update identity status type to UserStatus 2025-08-30 11:42:19 +03:30
nfel a8d454bf88 v2: brithdate missmatch added
Signed-off-by: nfel <nfilsaraee@gmail.com>
2025-08-20 14:07:42 +03:30
nfel cd4590689d v2: current price is added to asset.price
Signed-off-by: nfel <nfilsaraee@gmail.com>
2025-08-18 17:22:06 +03:30
nfel cf9408e76e Change user type in accounting 2025-08-17 16:00:57 +03:30
nfel 99a383a46d Merge pull request 'feat: add taker agreement already accepted err' (#33) from fix/market-taker into v2
Reviewed-on: #33
2025-08-17 11:16:47 +00:00
VQIVS 9acad665be feat: add taker agreement already accepted err 2025-08-17 14:20:04 +03:30
nfel 33dd406f16 v2: balance change added
Signed-off-by: nfel <nfilsaraee@gmail.com>
2025-08-13 14:37:28 +03:30
nfel 1d7e944469 v2: change param type of refund commission
Signed-off-by: nfel <nfilsaraee@gmail.com>
2025-08-13 12:37:42 +03:30
nfel 39298001c9 v2: withdraw_id -> id
Signed-off-by: nfel <nfilsaraee@gmail.com>
2025-08-13 12:35:39 +03:30
nfel e3dc270fec v2: withdraw id instead of trx id
Signed-off-by: nfel <nfilsaraee@gmail.com>
2025-08-13 12:31:46 +03:30
nfel b0a80e5dd3 v2: withdraw log msg + created status in accounting
Signed-off-by: nfel <nfilsaraee@gmail.com>
2025-08-13 12:29:16 +03:30
nfel 3555d27c03 v2: refund commission msg
Signed-off-by: nfel <nfilsaraee@gmail.com>
2025-08-13 11:30:45 +03:30
nfel 8d37693329 v2: added status for pending admin action
Signed-off-by: nfel <nfilsaraee@gmail.com>
2025-08-12 15:28:04 +03:30
nfel af0cab1c84 v2: bank info added to withdraw resp
Signed-off-by: nfel <nfilsaraee@gmail.com>
2025-08-12 15:26:28 +03:30
nfel 83e2597e53 v2: tfa added to withdraw irt req
Signed-off-by: nfel <nfilsaraee@gmail.com>
2025-08-12 15:24:23 +03:30
nfel ba1d530984 v2: removed ref_id from gen token payload + user added in accouting
Signed-off-by: nfel <nfilsaraee@gmail.com>
2025-08-12 13:34:25 +03:30
nfel c72c1adfd4 v2: err added in ipg confirm
Signed-off-by: nfel <nfilsaraee@gmail.com>
2025-08-11 16:03:09 +03:30
nfel 7d979a5377 v2: err
Signed-off-by: nfel <nfilsaraee@gmail.com>
2025-08-11 12:02:03 +03:30
nfel c9b7387a9e IPG messages added 2025-08-10 13:19:40 +03:30
nfel 975b9f4231 Merge pull request 'ref: delete decline contract rpc' (#32) from issue/#55 into v2
Reviewed-on: #32
2025-08-10 09:24:32 +00:00
VQIVS 6b408c1fc7 ref: delete decline contract rpc 2025-08-10 12:44:45 +03:30
VQIVS a5d2415699 feat: add contract not found error 2025-08-10 11:54:27 +03:30
nfel 668a569d6c Merge pull request 'feat: decline market contract rpc' (#31) from feat/decline-contract into v2
Reviewed-on: #31
2025-08-09 12:49:23 +00:00
6 changed files with 136 additions and 32 deletions
+1 -1
View File
@@ -161,7 +161,7 @@ message Identity {
string shenasname_number = 14;
string shenasname_seri = 15;
string shenasname_serial = 16;
int32 status = 17;
UserStatus status = 17;
string updated_at = 18;
string created_at = 19;
string email = 20;
+6 -1
View File
@@ -39,6 +39,7 @@ enum ErrCode {
INVALID_BUY_AMOUNT = 2015;
INVALID_BUY_AMOUNT_MAX = 2016;
INVALID_BUY_AMOUNT_MIN = 2017;
INVALID_ARGUMENT_TFA_REQUIRED = 2018;
// Resource errors
NOT_FOUND = 3000;
@@ -50,6 +51,7 @@ enum ErrCode {
BANK_INFO_NOT_FOUND = 3007;
RECIPIENT_NOT_FOUND = 3008;
USER_NOT_FOUND = 3009;
MARKET_AGREEMENT_ALREADY_ACCEPTED = 3010;
// Resource state errors
ASSET_NOT_ACTIVE = 4000;
@@ -103,7 +105,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
CONTRACT_NOT_FOUND = 7080;
NIL_AUTH = 7017;
CAN_NOT_BUY_AND_DEPOSIT = 7018;
WHITELIST_ALREADY_USED = 7027;
@@ -115,6 +117,9 @@ enum ErrCode {
MOBILE_NATIONAL_ID_MISS_MATCH = 7033;
NOT_ENOUGH_LOCKED_BALANCE = 7034;
NOT_ENOUGH_BALANCE_TO_LOCK = 7035;
IPG_GEN_TOKEN_FAILED = 7036;
USER_INFO_NATIONAL_ID_BIRTHDATE_MISS_MATCH = 7037;
// Server errors
SERVER_ERROR_FREEZED_BALANCE_NEGATIVE = 8000;
-1
View File
@@ -22,5 +22,4 @@ service MarketplaceSrv {
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);
}
+5 -1
View File
@@ -7,10 +7,14 @@ import "wallet/v1/msg.proto";
service InternalWalletSrv {
rpc InternalWalletSrvHealth(base.v1.Empty) returns (base.v1.StatusRes);
// Lock And Release Assets
rpc LockAsset(LockAssetReq) returns (base.v1.StatusRes);
rpc ReleaseAsset(LockAssetReq) returns (base.v1.StatusRes);
rpc CollectCommission(CommissionReq) returns (CommissionRes);
rpc RefundCommission(CommissionReq) returns (CommissionRes);
rpc RefundCommission(RefundCommissionReq) returns (CommissionRes);
// Calculate stellar pub-priv key based on national id
rpc GetPublicKeyByNationalID(NationalIDReq) returns (PubKeyRes);
}
+120 -18
View File
@@ -192,6 +192,7 @@ message AssetPrice {
string updated_at = 1;
double market_price = 2;
double ico_price = 3;
double current_price = 4;
}
message GetAssetReq {
@@ -363,6 +364,7 @@ enum TransactionStatus {
CREATED = -1;
PENDING_TRX = 1;
SUCCESSFUL = 2;
PENDING_ADMIN = 3;
}
message Transaction {
@@ -388,6 +390,13 @@ message Transaction {
optional string from_public_key = 19;
optional string to_public_key = 20;
double token_price = 21;
BalanceChange balance_change = 22;
}
enum BalanceChange{
NO_CHANGE = 0;
INCREASE = 1;
DECREASE = 2;
}
message TransactionListFilter {
@@ -558,12 +567,19 @@ message EffectiveCommission {
double total = 3;
}
message RefundCommissionReq {
auth.v1.UserIdentityBasic user = 3;
uint64 commission_log_id = 1;
}
message CommissionReq {
uint64 commission_id = 1;
double amount = 2;
auth.v1.UserIdentityBasic user = 3;
}
message CommissionRes {}
message CommissionRes {
uint64 commission_log_id = 1;
}
/*
* IPG - Internet Payment Gateway
@@ -579,6 +595,34 @@ message CommissionRes {}
// auth.v1.BankInfo bank_info = 2; // BankInfo
// }
enum AccountingType {
ACCOUNTING_TYPE_WITHDRAW = 0;
// Deposits
ACCOUNTING_TYPE_DEPOSIT_IPG = 10;
ACCOUNTING_TYPE_DEPOSIT_BANK_ACCOUNT = 11;
ACCOUNTING_TYPE_DEPOSIT_IBAN = 12;
ACCOUNTING_TYPE_DEPOSIT_CARD = 13;
ACCOUNTING_TYPE_DEPOSIT_DIRECT_DEBIT = 14;
// Withdraw
ACCOUNTING_TYPE_WITHDRAW_IBAN = 20; // User request to receive irt via iban
ACCOUNTING_TYPE_WITHDRAW_CARD = 21; // User request to receive irt via card no
ACCOUNTING_TYPE_WITHDRAW_BANK_ACCOUNT = 22; // User request to receive irt via bank
ACCOUNTING_TYPE_WITHDRAW_IPG_REFUND = 23;
// ???
}
enum AccountingStatus {
ACCOUNTING_STATUS_UNKNOWN = 0;
ACCOUNTING_STATUS_CREATED = 1;
ACCOUNTING_STATUS_PENDING = 2;
ACCOUNTING_STATUS_SUCCESS = 3;
ACCOUNTING_STATUS_FAILED = 4;
ACCOUNTING_STATUS_CANCELLED = 5;
ACCOUNTING_STATUS_REJECTED = 6;
}
enum IPGStatus {
IPG_SUCCESS = 0;
IPG_FAILED = -1;
@@ -588,33 +632,89 @@ enum IPGStatus {
// represent the information regarding the sale of the token
message IPGGetTokenReq {
auth.v1.InternalIAM iam = 1;
int64 asset_id = 2;
double amount = 3;
optional uint64 discount_code = 4;
double amount = 2;
repeated string allowed_card_numbers = 3;
}
// represent the information regarding the ipg gateway
message IPGGetTokenRes {
string url = 1;
int64 unit_price = 2;
int64 total_price = 3;
double amount = 4;
string asset = 5;
optional uint64 discount_code = 6;
int64 amount = 2;
}
message IPGConfirmReq {
string redirected_url = 1; // This field includes all of ipg's query params
// string ref_id = 1;
// string res_code = 2;
// string sale_order_id = 3;
// string sale_reference_id = 4;
// string card_holder_info = 5;
// string card_holder_pan = 6;
// string amount = 7;
}
message WithdrawLog {
uint64 id = 1;
Accounting accounting = 2;
string rrn = 3;
int64 amount = 4;
AccountingStatus status = 5;
string created_at = 6;
string updated_at = 7;
optional Transaction transaction = 8;
optional auth.v1.BankInfo bankinfo_id = 10;
optional bool accepted_by_admin = 11;
}
enum PSP {
PSP_UNKNOWN = 0;
PSP_VANDAR_BP_MELLAT = 10;
PSP_VANDAR_SEP = 11;
PSP_VANDAR = 12;
PSP_BP_MELLAT = 20;
}
message Accounting {
uint64 id = 1;
int64 user_id = 2;
int64 balance = 3;
auth.v1.UserIdentityBasic user = 4;
}
message IPGGenTokenPayload {
int64 amount = 2;
string payer_id = 3;
string mobile = 4;
string national_id = 5;
int64 order_id = 6;
string callback_url = 7;
repeated string bank_cards = 8;
}
message IPGLog {
string ref_id = 1;
string res_code = 2;
string sale_order_id = 3;
string sale_reference_id = 4;
string card_holder_info = 5;
string card_holder_pan = 6;
string final_amount = 7;
Accounting accounting = 2;
int64 amount = 4;
AccountingStatus status = 5;
string created_at = 6;
string updated_at = 7;
string token = 8;
PSP psp = 9;
optional int64 transaction_id = 10;
optional Transaction transaction = 11;
}
message IPGLogReq {
auth.v1.InternalIAM iam = 1;
string ref_id = 2;
}
message IPGConfirmRes {
string receipt_link = 1;
string ref_id = 1;
optional string error = 2;
}
message SaleManualReq {
@@ -640,12 +740,14 @@ message WithdrawIRTReq {
auth.v1.InternalIAM iam = 1;
double amount = 2;
int64 bank_info_id = 3;
auth.v1.TFA tfa = 4;
}
message WithdrawIRTRes {
int64 transaction_id = 1;
uint64 id = 1;
int64 amount = 2;
string transaction_hash = 3;
auth.v1.BankInfo bank_info = 4;
}
message BuyAssetReq {
@@ -690,7 +792,7 @@ message BuyAssetRes {
/* Contract */
enum ContractType {
CONTRACT_TYPE_ICO = 0;
CONTRACT_TYPE_MARKET = 1; //FIXME: Please remove this :)
CONTRACT_TYPE_MARKET = 1; // FIXME: Please remove this :)
CONTRACT_TYPE_BNPL = 2;
CONTRACT_TYPE_REDEEM = 3;
CONTRACT_TYPE_MARKET_MAKER = 4;
+4 -10
View File
@@ -9,19 +9,13 @@ import "wallet/v1/msg.proto";
service WalletService {
rpc WalletSrvHealth(base.v1.Empty) returns (base.v1.StatusRes);
// Internal rpc
rpc InternalWalletDeleteCache(base.v1.Empty) returns (base.v1.StatusRes);
rpc InternalCreateFederation(auth.v1.InternalIAM) returns (base.v1.StatusRes);
rpc GetPublicKeyByNationalID(NationalIDReq) returns (PubKeyRes);
rpc UserGetFederation(auth.v1.InternalIAM) returns (Federation);
rpc GetNetworkList(base.v1.Empty) returns (NetworkList);
rpc GetAssetList(AssetFilter) returns (AssetList);
rpc GetAsset(GetAssetReq) returns (Asset);
rpc GetAssetCommissions(base.v1.IdReq) returns (CommissionList);
rpc GetAssetPrice(base.v1.IdReq) returns (AssetPrice);
rpc AssetDiscount(AssetDiscountReq) returns (AssetDiscountRes);
rpc UserInitWallet(UserInitWalletReq) returns (base.v1.StatusRes);
rpc UserGetWalletList(auth.v1.InternalIAM) returns (WalletList);
@@ -34,8 +28,10 @@ service WalletService {
rpc IPGGetToken(IPGGetTokenReq) returns (IPGGetTokenRes);
// IPG Confirm is a public api
rpc IPGConfirm(IPGConfirmReq) returns (IPGConfirmRes);
rpc GetIPGLog(IPGLogReq) returns (IPGLog);
// Admin can increase user's balance as wish
rpc AdminManualSaleDeposit(SaleManualReq) returns (base.v1.StatusRes);
// rpc AdminManualSaleDeposit(SaleManualReq) returns (base.v1.StatusRes);
// BNPL
rpc GetBNPLList(base.v1.Empty) returns (BNPLList);
@@ -54,8 +50,6 @@ service WalletService {
rpc InternalTransferAsset(TransferAssetReq) returns (TransferAssetRes);
rpc ExternalTransferAsset(TransferAssetReq) returns (TransferAssetRes);
rpc AssetDiscount(AssetDiscountReq) returns (AssetDiscountRes);
// --- IRT ---
rpc WithdrawIRT(WithdrawIRTReq) returns (WithdrawIRTRes);
rpc DepositIRT(DepositIRTReq) returns (IPGGetTokenRes);