Skip to content

Commit

Permalink
feat(api): remove insecure APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
halibobo1205 committed Mar 30, 2023
1 parent 840664f commit ad5cba2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 121 deletions.
116 changes: 0 additions & 116 deletions api/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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) = {
Expand All @@ -707,10 +645,6 @@ service Wallet {
};
}

rpc AddSign (TransactionSign) returns (TransactionExtention) {

}

rpc GetTransactionSignWeight (Transaction) returns (TransactionSignWeight) {

}
Expand Down Expand Up @@ -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) {
}

Expand Down Expand Up @@ -1165,7 +1088,6 @@ message GetAvailableUnfreezeCountResponseMessage {
int64 count = 1;
}

//GetCanDelegatedMaxSize
message CanDelegatedMaxSizeRequestMessage {
int32 type = 1;
bytes owner_address = 2;
Expand All @@ -1174,7 +1096,6 @@ message CanDelegatedMaxSizeResponseMessage {
int64 max_size = 1;
}

//GetCanWithdrawUnfreezeAmount
message CanWithdrawUnfreezeAmountRequestMessage {
bytes owner_address = 1;
int64 timestamp = 2;
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 1 addition & 5 deletions core/Tron.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -600,6 +595,7 @@ enum ReasonCode {
CONNECT_FAIL = 0x21;
TOO_MANY_PEERS_WITH_SAME_IP = 0x22;
LIGHT_NODE_SYNC_FAIL = 0x23;
BELOW_THAN_ME = 0X24;
UNKNOWN = 0xFF;
}

Expand Down

0 comments on commit ad5cba2

Please sign in to comment.