From 8e64e1ca1fe0474d535863492f865e09743164bb Mon Sep 17 00:00:00 2001 From: hossein_225 Date: Mon, 9 Dec 2024 11:56:34 +0330 Subject: [PATCH 1/4] improve InternalTransferAsset rpc --- auth/v1/msg.proto | 6 ++++++ wallet/v1/msg.proto | 22 ++++++++++++++-------- wallet/v1/srv.proto | 4 +++- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/auth/v1/msg.proto b/auth/v1/msg.proto index cecaa7c..98ab4bf 100644 --- a/auth/v1/msg.proto +++ b/auth/v1/msg.proto @@ -208,3 +208,9 @@ message CheckTFAReq { optional string algorithm = 3; optional string reason = 4; // Can be later used as a lookup } + +message Otp { + string status = 1; + int64 code = 2; + string transaction_id = 3; +} \ No newline at end of file diff --git a/wallet/v1/msg.proto b/wallet/v1/msg.proto index 17156a4..56ea0dd 100644 --- a/wallet/v1/msg.proto +++ b/wallet/v1/msg.proto @@ -289,17 +289,23 @@ message UserBuyAssetReq { Transfer */ -message UserTransferAssetReq { +message InternalTransferAssetReq { auth.v1.InternalIAM iam = 1; - int64 asset_id = 2; - double amount = 3; - string to_wallet_address = 4; - string to_wallet_memo = 5; + string recipient = 2; + string amount = 3; + int64 network_id = 4; + int64 asset_id = 5; + bool approval = 6; + auth.v1.Otp otp = 7; } -message UserTransferRes { - int64 transaction_id = 1; - string tracking_code = 2; +message InternalTransferAssetRes { + string recipient = 1; + string recipient_first_name = 2; + string recipient_last_name = 3; + string amount = 4; + string transaction_id = 5; + string transaction_hash = 6; } // represent the information regarding the sale of the token diff --git a/wallet/v1/srv.proto b/wallet/v1/srv.proto index a352673..db06ba9 100644 --- a/wallet/v1/srv.proto +++ b/wallet/v1/srv.proto @@ -19,7 +19,6 @@ service WalletService { rpc UserInitWallet(UserInitWalletReq) returns (base.v1.StatusRes); rpc UserGetWalletList(auth.v1.InternalIAM) returns (WalletList); - rpc UserTransferAsset(UserTransferAssetReq) returns (UserTransferRes); rpc UserGetTransactionList(UserGetTransactionListReq) returns (TransactionList); @@ -41,4 +40,7 @@ service WalletService { rpc RedeemTokenList(auth.v1.ReqWithIAMAndParams) returns (RedeemTokenResList); rpc GetPublicKeyByNationalID(GetPublicKeyByNationalIDReq) returns (GetPublicKeyByNationalIDRes); + + // Assets routing + rpc InternalTransferAsset(InternalTransferAssetReq) returns (InternalTransferAssetRes); } -- 2.47.2 From e21e98568b746e02cdf3a429d23656111f99a119 Mon Sep 17 00:00:00 2001 From: hossein_225 Date: Mon, 9 Dec 2024 12:00:13 +0330 Subject: [PATCH 2/4] change Otp name --- auth/v1/msg.proto | 2 +- wallet/v1/msg.proto | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/auth/v1/msg.proto b/auth/v1/msg.proto index 98ab4bf..1787638 100644 --- a/auth/v1/msg.proto +++ b/auth/v1/msg.proto @@ -209,7 +209,7 @@ message CheckTFAReq { optional string reason = 4; // Can be later used as a lookup } -message Otp { +message TFA { string status = 1; int64 code = 2; string transaction_id = 3; diff --git a/wallet/v1/msg.proto b/wallet/v1/msg.proto index 56ea0dd..6f6cdcb 100644 --- a/wallet/v1/msg.proto +++ b/wallet/v1/msg.proto @@ -296,7 +296,7 @@ message InternalTransferAssetReq { int64 network_id = 4; int64 asset_id = 5; bool approval = 6; - auth.v1.Otp otp = 7; + auth.v1.TFA tfa = 7; } message InternalTransferAssetRes { -- 2.47.2 From 6ecb53aecd709d29744e713632397b9716d349e4 Mon Sep 17 00:00:00 2001 From: hossein_225 Date: Mon, 9 Dec 2024 12:05:30 +0330 Subject: [PATCH 3/4] add Recipient message --- wallet/v1/msg.proto | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/wallet/v1/msg.proto b/wallet/v1/msg.proto index 6f6cdcb..b24ff8c 100644 --- a/wallet/v1/msg.proto +++ b/wallet/v1/msg.proto @@ -289,23 +289,27 @@ message UserBuyAssetReq { Transfer */ +message Recipient { + string recipient = 1; + string recipient_first_name = 2; + string recipient_last_name = 3; +} + message InternalTransferAssetReq { auth.v1.InternalIAM iam = 1; - string recipient = 2; + Recipient recipient = 2; string amount = 3; - int64 network_id = 4; + optional int64 network_id = 4; int64 asset_id = 5; - bool approval = 6; + optional bool approval = 6; auth.v1.TFA tfa = 7; } message InternalTransferAssetRes { - string recipient = 1; - string recipient_first_name = 2; - string recipient_last_name = 3; - string amount = 4; - string transaction_id = 5; - string transaction_hash = 6; + Recipient recipient = 1; + string amount = 2; + string transaction_id = 3; + string transaction_hash = 4; } // represent the information regarding the sale of the token -- 2.47.2 From 36af98b1866fb64cc1d33d1108f040a56bac6868 Mon Sep 17 00:00:00 2001 From: hossein_225 Date: Mon, 9 Dec 2024 12:13:55 +0330 Subject: [PATCH 4/4] add some optional feat & change key name in TFA --- auth/v1/msg.proto | 2 +- wallet/v1/msg.proto | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/auth/v1/msg.proto b/auth/v1/msg.proto index 1787638..d09aeac 100644 --- a/auth/v1/msg.proto +++ b/auth/v1/msg.proto @@ -210,7 +210,7 @@ message CheckTFAReq { } message TFA { - string status = 1; + string key = 1; int64 code = 2; string transaction_id = 3; } \ No newline at end of file diff --git a/wallet/v1/msg.proto b/wallet/v1/msg.proto index b24ff8c..99140f8 100644 --- a/wallet/v1/msg.proto +++ b/wallet/v1/msg.proto @@ -290,9 +290,9 @@ message UserBuyAssetReq { */ message Recipient { - string recipient = 1; - string recipient_first_name = 2; - string recipient_last_name = 3; + string id = 1; + optional string first_name = 2; + optional string last_name = 3; } message InternalTransferAssetReq { @@ -302,7 +302,7 @@ message InternalTransferAssetReq { optional int64 network_id = 4; int64 asset_id = 5; optional bool approval = 6; - auth.v1.TFA tfa = 7; + optional auth.v1.TFA tfa = 7; } message InternalTransferAssetRes { -- 2.47.2