Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 61 additions & 8 deletions api/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import "core/contract/balance_contract.proto";
import "core/contract/proposal_contract.proto";
import "core/contract/storage_contract.proto";
import "core/contract/exchange_contract.proto";
import "core/contract/market_contract.proto";
import "core/contract/smart_contract.proto";
import "core/contract/shield_contract.proto";

Expand Down Expand Up @@ -286,6 +287,28 @@ service Wallet {
rpc ExchangeTransaction (ExchangeTransactionContract) returns (TransactionExtention) {
}

rpc MarketSellAsset (MarketSellAssetContract) returns (TransactionExtention) {
}

rpc MarketCancelOrder (MarketCancelOrderContract) returns (TransactionExtention) {
}

rpc GetMarketOrderById (BytesMessage) returns (MarketOrder) {
}

rpc GetMarketOrderByAccount (BytesMessage) returns (MarketOrderList) {
}

rpc GetMarketPriceByPair (MarketOrderPair) returns (MarketPriceList) {
}

rpc GetMarketOrderListByPair (MarketOrderPair) returns (MarketOrderList) {
}

rpc GetMarketPairList (EmptyMessage) returns (MarketOrderPairList) {
}


rpc ListNodes (EmptyMessage) returns (NodeList) {
option (google.api.http) = {
post: "/wallet/listnodes"
Expand Down Expand Up @@ -410,6 +433,9 @@ service Wallet {
rpc GetContract (BytesMessage) returns (SmartContract) {
}

rpc GetContractInfo (BytesMessage) returns (SmartContractDataWrapper) {
}

rpc TriggerContract (TriggerSmartContract) returns (TransactionExtention) {
}

Expand Down Expand Up @@ -899,6 +925,21 @@ service WalletSolidity {
rpc GetTransactionInfoByBlockNum (NumberMessage) returns (TransactionInfoList) {
}

rpc GetMarketOrderById (BytesMessage) returns (MarketOrder) {
}

rpc GetMarketOrderByAccount (BytesMessage) returns (MarketOrderList) {
}

rpc GetMarketPriceByPair (MarketOrderPair) returns (MarketPriceList) {
}

rpc GetMarketOrderListByPair (MarketOrderPair) returns (MarketOrderList) {
}

rpc GetMarketPairList (EmptyMessage) returns (MarketOrderPairList) {
}

};

service WalletExtension {
Expand Down Expand Up @@ -947,6 +988,18 @@ service Database {
}
};

service Monitor {
rpc GetStatsInfo (EmptyMessage) returns (MetricsInfo) {
option (google.api.http) = {
post: "/monitor/getstatsinfo"
body: "*"
additional_bindings {
get: "/monitor/getstatsinfo"
}
};
}
}

message Return {
enum response_code {
SUCCESS = 0;
Expand Down Expand Up @@ -1115,7 +1168,7 @@ message EasyTransferAssetByPrivateMessage {
message EasyTransferResponse {
Transaction transaction = 1;
Return result = 2;
bytes txid = 3; //transaction id = sha256(transaction.raw_data)
bytes txid = 3; //transaction id = sha256(transaction.rowdata)
}

message AddressPrKeyPairMessage {
Expand All @@ -1125,7 +1178,7 @@ message AddressPrKeyPairMessage {

message TransactionExtention {
Transaction transaction = 1;
bytes txid = 2; //transaction id = sha256(transaction.raw_data)
bytes txid = 2; //transaction id = sha256(transaction.rowdata)
repeated bytes constant_result = 3;
Return result = 4;
}
Expand Down Expand Up @@ -1210,7 +1263,7 @@ message OvkDecryptParameters {
message DecryptNotes {
message NoteTx {
Note note = 1;
bytes txid = 2; //transaction id = sha256(transaction.raw_data)
bytes txid = 2; //transaction id = sha256(transaction.rowdata)
int32 index = 3; //the index of note in receive
}
repeated NoteTx noteTxs = 1;
Expand All @@ -1219,7 +1272,7 @@ message DecryptNotes {
message DecryptNotesMarked {
message NoteTx {
Note note = 1;
bytes txid = 2; //transaction id = sha256(transaction.raw_data)
bytes txid = 2; //transaction id = sha256(transaction.rowdata)
int32 index = 3; //the index of note in receive
bool is_spend = 4;
}
Expand Down Expand Up @@ -1254,7 +1307,7 @@ message PrivateParameters {
repeated ReceiveNote shielded_receives = 7;
bytes transparent_to_address = 8;
int64 to_amount = 9;
int64 timeout = 10; // timeout in seconds, it works only when it bigger than 0
int64 timeout = 10; // timeout in seconds, it works only when it bigger than 0
}

message PrivateParametersWithoutAsk {
Expand All @@ -1267,7 +1320,7 @@ message PrivateParametersWithoutAsk {
repeated ReceiveNote shielded_receives = 7;
bytes transparent_to_address = 8;
int64 to_amount = 9;
int64 timeout = 10; // timeout in seconds, it works only when it bigger than 0
int64 timeout = 10; // timeout in seconds, it works only when it bigger than 0
}

message SpendAuthSigParameters {
Expand Down Expand Up @@ -1313,7 +1366,7 @@ message PaymentAddressMessage {
string payment_address = 3;
}

message ShieldedAddressInfo{
message ShieldedAddressInfo {
bytes sk = 1;
bytes ask = 2;
bytes nsk = 3;
Expand Down Expand Up @@ -1432,4 +1485,4 @@ message ShieldedTRC20TriggerContractParameters {
repeated BytesMessage spend_authority_signature = 2;
string amount = 3;
bytes transparent_to_address = 4;
}
}
18 changes: 9 additions & 9 deletions api/zksnark.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ service TronZksnark {
};

message ZksnarkRequest {
Transaction transaction = 1;
bytes sighash = 2;
int64 valueBalance = 3;
string txId = 4;
Transaction transaction = 1;
bytes sighash = 2;
int64 valueBalance = 3;
string txId = 4;
}

message ZksnarkResponse {
enum Code {
SUCCESS = 0;
FAILED = 1;
}
enum Code {
SUCCESS = 0;
FAILED = 1;
}

Code code = 1;
Code code = 1;
}


Expand Down
Loading