From 0645b524b58c10f1c0bee3484bdcda8b81c0a525 Mon Sep 17 00:00:00 2001 From: halibobo1205 Date: Thu, 30 Mar 2023 15:37:54 +0800 Subject: [PATCH] feat(api): remove insecure APIs --- api/api.proto | 116 ------------------------------------------------ core/Tron.proto | 5 --- 2 files changed, 121 deletions(-) diff --git a/api/api.proto b/api/api.proto index 95871f5aa..70297d095 100644 --- a/api/api.proto +++ b/api/api.proto @@ -624,68 +624,6 @@ service Wallet { } }; } - //Warning: do not invoke this interface provided by others. - //Please use GetTransactionSign2 instead of this function. - rpc GetTransactionSign (TransactionSign) returns (Transaction) { - option (google.api.http) = { - post: "/wallet/gettransactionsign" - body: "*" - additional_bindings { - get: "/wallet/gettransactionsign" - } - }; - }; - //Warning: do not invoke this interface provided by others. - //Use this function instead of GetTransactionSign. - rpc GetTransactionSign2 (TransactionSign) returns (TransactionExtention) { - }; - //Warning: do not invoke this interface provided by others. - rpc CreateAddress (BytesMessage) returns (BytesMessage) { - option (google.api.http) = { - post: "/wallet/createaddress" - body: "*" - additional_bindings { - get: "/wallet/createaddress" - } - }; - }; - //Warning: do not invoke this interface provided by others. - rpc EasyTransferAsset (EasyTransferAssetMessage) returns (EasyTransferResponse) { - }; - //Warning: do not invoke this interface provided by others. - rpc EasyTransferAssetByPrivate (EasyTransferAssetByPrivateMessage) returns (EasyTransferResponse) { - }; - //Warning: do not invoke this interface provided by others. - rpc EasyTransfer (EasyTransferMessage) returns (EasyTransferResponse) { - option (google.api.http) = { - post: "/wallet/easytransfer" - body: "*" - additional_bindings { - get: "/wallet/easytransfer" - } - }; - }; - //Warning: do not invoke this interface provided by others. - rpc EasyTransferByPrivate (EasyTransferByPrivateMessage) returns (EasyTransferResponse) { - option (google.api.http) = { - post: "/wallet/easytransferbyprivate" - body: "*" - additional_bindings { - get: "/wallet/easytransferbyprivate" - } - }; - }; - //Warning: do not invoke this interface provided by others. - rpc GenerateAddress (EmptyMessage) returns (AddressPrKeyPairMessage) { - - option (google.api.http) = { - post: "/wallet/generateaddress" - body: "*" - additional_bindings { - get: "/wallet/generateaddress" - } - }; - } rpc GetTransactionInfoById (BytesMessage) returns (TransactionInfo) { option (google.api.http) = { @@ -707,10 +645,6 @@ service Wallet { }; } - rpc AddSign (TransactionSign) returns (TransactionExtention) { - - } - rpc GetTransactionSignWeight (Transaction) returns (TransactionSignWeight) { } @@ -968,17 +902,6 @@ service WalletSolidity { }; } - //Warning: do not invoke this interface provided by others. - rpc GenerateAddress (EmptyMessage) returns (AddressPrKeyPairMessage) { - option (google.api.http) = { - post: "/walletsolidity/generateaddress" - body: "*" - additional_bindings { - get: "/walletsolidity/generateaddress" - } - }; - } - rpc GetMerkleTreeVoucherInfo (OutputPointInfo) returns (IncrementalMerkleVoucherInfo) { } @@ -1165,7 +1088,6 @@ message GetAvailableUnfreezeCountResponseMessage { int64 count = 1; } -//GetCanDelegatedMaxSize message CanDelegatedMaxSizeRequestMessage { int32 type = 1; bytes owner_address = 2; @@ -1174,7 +1096,6 @@ message CanDelegatedMaxSizeResponseMessage { int64 max_size = 1; } -//GetCanWithdrawUnfreezeAmount message CanWithdrawUnfreezeAmountRequestMessage { bytes owner_address = 1; int64 timestamp = 2; @@ -1271,43 +1192,6 @@ message PaginatedMessage { int64 limit = 2; } -message EasyTransferMessage { - bytes passPhrase = 1; - bytes toAddress = 2; - int64 amount = 3; -} - -message EasyTransferAssetMessage { - bytes passPhrase = 1; - bytes toAddress = 2; - string assetId = 3; - int64 amount = 4; -} - -message EasyTransferByPrivateMessage { - bytes privateKey = 1; - bytes toAddress = 2; - int64 amount = 3; -} - -message EasyTransferAssetByPrivateMessage { - bytes privateKey = 1; - bytes toAddress = 2; - string assetId = 3; - int64 amount = 4; -} - -message EasyTransferResponse { - Transaction transaction = 1; - Return result = 2; - bytes txid = 3; //transaction id = sha256(transaction.rowdata) -} - -message AddressPrKeyPairMessage { - string address = 1; - string privateKey = 2; -} - message TransactionExtention { Transaction transaction = 1; bytes txid = 2; //transaction id = sha256(transaction.rowdata) diff --git a/core/Tron.proto b/core/Tron.proto index e6aac408f..dafee3a6a 100644 --- a/core/Tron.proto +++ b/core/Tron.proto @@ -494,11 +494,6 @@ message Transactions { repeated Transaction transactions = 1; } -message TransactionSign { - Transaction transaction = 1; - bytes privateKey = 2; -} - message BlockHeader { message raw { int64 timestamp = 1;