diff --git a/api/api.proto b/api/api.proto index 03c1e3e6b..7eb38fee7 100644 --- a/api/api.proto +++ b/api/api.proto @@ -11,9 +11,9 @@ 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"; -import "core/contract/market_contract.proto"; option java_package = "org.tron.api"; //Specify the name of the package that generated the Java file option java_outer_classname = "GrpcAPI"; //Specify the class name of the generated Java file @@ -287,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" @@ -735,29 +757,6 @@ service Wallet { rpc GetTransactionInfoByBlockNum (NumberMessage) returns (TransactionInfoList) { } - - // for market - rpc MarketSellAsset (MarketSellAssetContract) returns (TransactionExtention) { - } - - rpc MarketCancelOrder (MarketCancelOrderContract) returns (TransactionExtention) { - } - - rpc GetMarketOrderByAccount (BytesMessage) returns (MarketOrderList) { - } - - rpc GetMarketOrderById (BytesMessage) returns (MarketOrder) { - } - - rpc GetMarketPriceByPair (MarketOrderPair) returns (MarketPriceList) { - } - - rpc GetMarketOrderListByPair (MarketOrderPair) returns (MarketOrderList) { - } - - rpc GetMarketPairList (EmptyMessage) returns (MarketOrderPairList) { - } - // end for market }; service WalletSolidity { @@ -926,10 +925,10 @@ service WalletSolidity { rpc GetTransactionInfoByBlockNum (NumberMessage) returns (TransactionInfoList) { } - rpc GetMarketOrderByAccount (BytesMessage) returns (MarketOrderList) { + rpc GetMarketOrderById (BytesMessage) returns (MarketOrder) { } - rpc GetMarketOrderById (BytesMessage) returns (MarketOrder) { + rpc GetMarketOrderByAccount (BytesMessage) returns (MarketOrderList) { } rpc GetMarketPriceByPair (MarketOrderPair) returns (MarketPriceList) { @@ -940,6 +939,7 @@ service WalletSolidity { rpc GetMarketPairList (EmptyMessage) returns (MarketOrderPairList) { } + }; service WalletExtension { @@ -988,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; @@ -1156,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 { @@ -1166,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; } @@ -1251,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; @@ -1260,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; } @@ -1295,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 { @@ -1308,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 { @@ -1354,7 +1366,7 @@ message PaymentAddressMessage { string payment_address = 3; } -message ShieldedAddressInfo{ +message ShieldedAddressInfo { bytes sk = 1; bytes ask = 2; bytes nsk = 3; @@ -1473,4 +1485,4 @@ message ShieldedTRC20TriggerContractParameters { repeated BytesMessage spend_authority_signature = 2; string amount = 3; bytes transparent_to_address = 4; -} \ No newline at end of file +} diff --git a/api/zksnark.proto b/api/zksnark.proto index 91b985651..bc0764cb5 100644 --- a/api/zksnark.proto +++ b/api/zksnark.proto @@ -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; } diff --git a/core/Tron.proto b/core/Tron.proto index cec919247..ccc11cde4 100644 --- a/core/Tron.proto +++ b/core/Tron.proto @@ -58,6 +58,67 @@ message Exchange { int64 second_token_balance = 9; } +// market +message MarketOrder { + bytes order_id = 1; + bytes owner_address = 2; + int64 create_time = 3; + bytes sell_token_id = 4; + int64 sell_token_quantity = 5; + bytes buy_token_id = 6; + int64 buy_token_quantity = 7; // min to receive + int64 sell_token_quantity_remain = 9; + // When state != ACTIVE and sell_token_quantity_return !=0, + //it means that some sell tokens are returned to the account due to insufficient remaining amount + int64 sell_token_quantity_return = 10; + + enum State { + ACTIVE = 0; + INACTIVE = 1; + CANCELED = 2; + } + State state = 11; + + bytes prev = 12; + bytes next = 13; +} + +message MarketOrderList { + repeated MarketOrder orders = 1; +} + +message MarketOrderPairList { + repeated MarketOrderPair orderPair = 1; +} + +message MarketOrderPair{ + bytes sell_token_id = 1; + bytes buy_token_id = 2; +} + +message MarketAccountOrder { + bytes owner_address = 1; + repeated bytes orders = 2; // order_id list + int64 count = 3; // active count + int64 total_count = 4; +} + +message MarketPrice { + int64 sell_token_quantity = 1; + int64 buy_token_quantity = 2; +} + +message MarketPriceList { + bytes sell_token_id = 1; + bytes buy_token_id = 2; + repeated MarketPrice prices = 3; +} + +message MarketOrderIdList { + bytes head = 1; + bytes tail = 2; +} + message ChainParameters { repeated ChainParameter chainParameter = 1; message ChainParameter { @@ -323,6 +384,10 @@ message Transaction { int64 exchange_withdraw_another_amount = 20; int64 exchange_id = 21; int64 shielded_transaction_fee = 22; + + + bytes orderId = 25; + repeated MarketOrderDetail orderDetails = 26; } message raw { @@ -331,9 +396,9 @@ message Transaction { bytes ref_block_hash = 4; int64 expiration = 8; repeated authority auths = 9; - // transaction note + // data not used bytes data = 10; - //only support size = 1, repeated list here for extension + //only support size = 1, repeated list here for extension repeated Contract contract = 11; // scripts not used bytes scripts = 12; @@ -342,7 +407,7 @@ message Transaction { } raw raw_data = 1; - // only support size = 1, repeated list here for muti-sig extension + // only support size = 1, repeated list here for muti-sig extension repeated bytes signature = 2; repeated Result ret = 5; } @@ -380,6 +445,7 @@ message TransactionInfo { bytes orderId = 25; repeated MarketOrderDetail orderDetails = 26; + } message TransactionRet { @@ -516,6 +582,8 @@ message HelloMessage { BlockId genesisBlockId = 4; BlockId solidBlockId = 5; BlockId headBlockId = 6; + bytes address = 7; + bytes signature = 8; } message InternalTransaction { @@ -616,7 +684,7 @@ message NodeInfo { double cpuRate = 6; string javaVersion = 7; string osName = 8; - int64 jvmTotalMemoery = 9; + int64 jvmTotalMemory = 9; int64 jvmFreeMemory = 10; double processCpuRate = 11; repeated MemoryDescInfo memoryDescInfoList = 12; @@ -642,63 +710,138 @@ message NodeInfo { } } -// market -message MarketOrder { - bytes order_id = 1; - bytes owner_address = 2; - int64 create_time = 3; - bytes sell_token_id = 4; - int64 sell_token_quantity = 5; - bytes buy_token_id = 6; - int64 buy_token_quantity = 7; // min to receive - int64 sell_token_quantity_remain = 9; - // When state != ACTIVE and sell_token_quantity_return !=0, - //it means that some sell tokens are returned to the account due to insufficient remaining amount - int64 sell_token_quantity_return = 10; +message MetricsInfo { + int64 interval = 1; + NodeInfo node = 2; + BlockChainInfo blockchain = 3; + NetInfo net = 4; - enum State { - ACTIVE = 0; - INACTIVE = 1; - CANCELED = 2; + message NodeInfo { + string ip = 1; + int32 nodeType = 2; + string version = 3; + int32 backupStatus = 4; } - State state = 11; - bytes prev = 12; - bytes next = 13; -} + message BlockChainInfo { + int64 headBlockNum = 1; + int64 headBlockTimestamp = 2; + string headBlockHash = 3; + int32 forkCount = 4; + int32 failForkCount = 5; + RateInfo blockProcessTime = 6; + RateInfo tps = 7; + int32 transactionCacheSize = 8; + RateInfo missedTransaction = 9; + repeated Witness witnesses = 10; + int64 failProcessBlockNum = 11; + string failProcessBlockReason = 12; + repeated DupWitness dupWitness = 13; + + message Witness { + string address = 1; + int32 version = 2; + } -message MarketOrderList { - repeated MarketOrder orders = 1; -} + message DupWitness { + string address = 1; + int64 blockNum = 2; + int32 count = 3; + } + } -message MarketOrderPairList { - repeated MarketOrderPair orderPair = 1; -} + message RateInfo { + int64 count = 1; + double meanRate = 2; + double oneMinuteRate = 3; + double fiveMinuteRate = 4; + double fifteenMinuteRate = 5; + } -message MarketOrderPair{ - bytes sell_token_id = 1; - bytes buy_token_id = 2; -} + message NetInfo { + int32 errorProtoCount = 1; + ApiInfo api = 2; + int32 connectionCount = 3; + int32 validConnectionCount = 4; + RateInfo tcpInTraffic = 5; + RateInfo tcpOutTraffic = 6; + int32 disconnectionCount = 7; + repeated DisconnectionDetailInfo disconnectionDetail = 8; + RateInfo udpInTraffic = 9; + RateInfo udpOutTraffic = 10; + LatencyInfo latency = 11; + + message ApiInfo { + RateInfo qps = 1; + RateInfo failQps = 2; + RateInfo outTraffic = 3; + repeated ApiDetailInfo detail = 4; + + message ApiDetailInfo { + string name = 1; + RateInfo qps = 2; + RateInfo failQps = 3; + RateInfo outTraffic = 4; + } + } -message MarketAccountOrder { - bytes owner_address = 1; - repeated bytes orders = 2; // order_id list - int64 count = 3; // active count - int64 total_count = 4; + message DisconnectionDetailInfo { + string reason = 1; + int32 count = 2; + } + + message LatencyInfo { + int32 top99 = 1; + int32 top95 = 2; + int32 top75 = 3; + int32 totalCount = 4; + int32 delay1S = 5; + int32 delay2S = 6; + int32 delay3S = 7; + repeated LatencyDetailInfo detail = 8; + + message LatencyDetailInfo { + string witness = 1; + int32 top99 = 2; + int32 top95 = 3; + int32 top75 = 4; + int32 count = 5; + int32 delay1S = 6; + int32 delay2S = 7; + int32 delay3S = 8; + } + } + } } -message MarketPrice { - int64 sell_token_quantity = 1; - int64 buy_token_quantity = 2; +message PBFTMessage { + enum MsgType { + VIEW_CHANGE = 0; + REQUEST = 1; + PREPREPARE = 2; + PREPARE = 3; + COMMIT = 4; + } + enum DataType { + BLOCK = 0; + SRL = 1; + } + message Raw { + MsgType msg_type = 1; + DataType data_type = 2; + int64 view_n = 3; + int64 epoch = 4; + bytes data = 5; + } + Raw raw_data = 1; + bytes signature = 2; } -message MarketPriceList { - bytes sell_token_id = 1; - bytes buy_token_id = 2; - repeated MarketPrice prices = 3; +message PBFTCommitResult { + bytes data = 1; + repeated bytes signature = 2; } -message MarketOrderIdList { - bytes head = 1; - bytes tail = 2; +message SRL { + repeated bytes srAddress = 1; } diff --git a/core/contract/asset_issue_contract.proto b/core/contract/asset_issue_contract.proto index cdd086a2b..eb86b1702 100644 --- a/core/contract/asset_issue_contract.proto +++ b/core/contract/asset_issue_contract.proto @@ -7,54 +7,54 @@ option java_package = "org.tron.protos.contract"; //Specify the name of the pack option go_package = "github.com/tronprotocol/grpc-gateway/core"; message AssetIssueContract { - string id = 41; - - message FrozenSupply { - int64 frozen_amount = 1; - int64 frozen_days = 2; - } - bytes owner_address = 1; - bytes name = 2; - bytes abbr = 3; - int64 total_supply = 4; - repeated FrozenSupply frozen_supply = 5; - int32 trx_num = 6; - int32 precision = 7; - int32 num = 8; - int64 start_time = 9; - int64 end_time = 10; - int64 order = 11; // useless - int32 vote_score = 16; - bytes description = 20; - bytes url = 21; - int64 free_asset_net_limit = 22; - int64 public_free_asset_net_limit = 23; - int64 public_free_asset_net_usage = 24; - int64 public_latest_free_net_time = 25; + string id = 41; + + message FrozenSupply { + int64 frozen_amount = 1; + int64 frozen_days = 2; + } + bytes owner_address = 1; + bytes name = 2; + bytes abbr = 3; + int64 total_supply = 4; + repeated FrozenSupply frozen_supply = 5; + int32 trx_num = 6; + int32 precision = 7; + int32 num = 8; + int64 start_time = 9; + int64 end_time = 10; + int64 order = 11; // useless + int32 vote_score = 16; + bytes description = 20; + bytes url = 21; + int64 free_asset_net_limit = 22; + int64 public_free_asset_net_limit = 23; + int64 public_free_asset_net_usage = 24; + int64 public_latest_free_net_time = 25; } message TransferAssetContract { - bytes asset_name = 1; // this field is token name before the proposal ALLOW_SAME_TOKEN_NAME is active, otherwise it is token id and token is should be in string format. - bytes owner_address = 2; - bytes to_address = 3; - int64 amount = 4; + bytes asset_name = 1; // this field is token name before the proposal ALLOW_SAME_TOKEN_NAME is active, otherwise it is token id and token is should be in string format. + bytes owner_address = 2; + bytes to_address = 3; + int64 amount = 4; } message UnfreezeAssetContract { - bytes owner_address = 1; + bytes owner_address = 1; } message UpdateAssetContract { - bytes owner_address = 1; - bytes description = 2; - bytes url = 3; - int64 new_limit = 4; - int64 new_public_limit = 5; + bytes owner_address = 1; + bytes description = 2; + bytes url = 3; + int64 new_limit = 4; + int64 new_public_limit = 5; } message ParticipateAssetIssueContract { - bytes owner_address = 1; - bytes to_address = 2; - bytes asset_name = 3; // this field is token name before the proposal ALLOW_SAME_TOKEN_NAME is active, otherwise it is token id and token is should be in string format. - int64 amount = 4; // the amount of drops -} + bytes owner_address = 1; + bytes to_address = 2; + bytes asset_name = 3; // this field is token name before the proposal ALLOW_SAME_TOKEN_NAME is active, otherwise it is token id and token is should be in string format. + int64 amount = 4; // the amount of drops +} \ No newline at end of file diff --git a/core/contract/balance_contract.proto b/core/contract/balance_contract.proto index 07f7141f6..5dd3dd177 100644 --- a/core/contract/balance_contract.proto +++ b/core/contract/balance_contract.proto @@ -9,28 +9,28 @@ option go_package = "github.com/tronprotocol/grpc-gateway/core"; import "core/contract/common.proto"; message FreezeBalanceContract { - bytes owner_address = 1; - int64 frozen_balance = 2; - int64 frozen_duration = 3; + bytes owner_address = 1; + int64 frozen_balance = 2; + int64 frozen_duration = 3; - ResourceCode resource = 10; - bytes receiver_address = 15; + ResourceCode resource = 10; + bytes receiver_address = 15; } message UnfreezeBalanceContract { - bytes owner_address = 1; + bytes owner_address = 1; - ResourceCode resource = 10; - bytes receiver_address = 15; + ResourceCode resource = 10; + bytes receiver_address = 15; } message WithdrawBalanceContract { - bytes owner_address = 1; + bytes owner_address = 1; } message TransferContract { - bytes owner_address = 1; - bytes to_address = 2; - int64 amount = 3; -} + bytes owner_address = 1; + bytes to_address = 2; + int64 amount = 3; +} \ No newline at end of file diff --git a/core/contract/common.proto b/core/contract/common.proto index 933c5f5d0..9396c4a66 100644 --- a/core/contract/common.proto +++ b/core/contract/common.proto @@ -7,6 +7,6 @@ option java_package = "org.tron.protos.contract"; //Specify the name of the pack option go_package = "github.com/tronprotocol/grpc-gateway/core"; enum ResourceCode { - BANDWIDTH = 0x00; - ENERGY = 0x01; -} + BANDWIDTH = 0x00; + ENERGY = 0x01; +} \ No newline at end of file diff --git a/core/contract/exchange_contract.proto b/core/contract/exchange_contract.proto index 58d69cc2a..8b8878f04 100644 --- a/core/contract/exchange_contract.proto +++ b/core/contract/exchange_contract.proto @@ -7,31 +7,31 @@ option java_package = "org.tron.protos.contract"; //Specify the name of the pack option go_package = "github.com/tronprotocol/grpc-gateway/core"; message ExchangeCreateContract { - bytes owner_address = 1; - bytes first_token_id = 2; - int64 first_token_balance = 3; - bytes second_token_id = 4; - int64 second_token_balance = 5; + bytes owner_address = 1; + bytes first_token_id = 2; + int64 first_token_balance = 3; + bytes second_token_id = 4; + int64 second_token_balance = 5; } message ExchangeInjectContract { - bytes owner_address = 1; - int64 exchange_id = 2; - bytes token_id = 3; - int64 quant = 4; + bytes owner_address = 1; + int64 exchange_id = 2; + bytes token_id = 3; + int64 quant = 4; } message ExchangeWithdrawContract { - bytes owner_address = 1; - int64 exchange_id = 2; - bytes token_id = 3; - int64 quant = 4; + bytes owner_address = 1; + int64 exchange_id = 2; + bytes token_id = 3; + int64 quant = 4; } message ExchangeTransactionContract { - bytes owner_address = 1; - int64 exchange_id = 2; - bytes token_id = 3; - int64 quant = 4; - int64 expected = 5; -} + bytes owner_address = 1; + int64 exchange_id = 2; + bytes token_id = 3; + int64 quant = 4; + int64 expected = 5; +} \ No newline at end of file diff --git a/core/contract/market_contract.proto b/core/contract/market_contract.proto index ae36fc62a..e12743500 100644 --- a/core/contract/market_contract.proto +++ b/core/contract/market_contract.proto @@ -6,14 +6,14 @@ option java_package = "org.tron.protos.contract"; //Specify the name of the pack option go_package = "github.com/tronprotocol/grpc-gateway/core"; message MarketSellAssetContract { - bytes owner_address = 1; - bytes sell_token_id = 2; - int64 sell_token_quantity = 3; - bytes buy_token_id = 4; - int64 buy_token_quantity = 5; // min to receive + bytes owner_address = 1; + bytes sell_token_id = 2; + int64 sell_token_quantity = 3; + bytes buy_token_id = 4; + int64 buy_token_quantity = 5; // min to receive } message MarketCancelOrderContract { - bytes owner_address = 1; - bytes order_id = 2; + bytes owner_address = 1; + bytes order_id = 2; } \ No newline at end of file diff --git a/core/contract/proposal_contract.proto b/core/contract/proposal_contract.proto index 1dc74d8f7..35bb9ca76 100644 --- a/core/contract/proposal_contract.proto +++ b/core/contract/proposal_contract.proto @@ -7,17 +7,17 @@ option java_package = "org.tron.protos.contract"; //Specify the name of the pack option go_package = "github.com/tronprotocol/grpc-gateway/core"; message ProposalApproveContract { - bytes owner_address = 1; - int64 proposal_id = 2; - bool is_add_approval = 3; // add or remove approval + bytes owner_address = 1; + int64 proposal_id = 2; + bool is_add_approval = 3; // add or remove approval } message ProposalCreateContract { - bytes owner_address = 1; - map parameters = 2; + bytes owner_address = 1; + map parameters = 2; } message ProposalDeleteContract { - bytes owner_address = 1; - int64 proposal_id = 2; -} + bytes owner_address = 1; + int64 proposal_id = 2; +} \ No newline at end of file diff --git a/core/contract/shield_contract.proto b/core/contract/shield_contract.proto index 9119a7aef..660f9ddf7 100644 --- a/core/contract/shield_contract.proto +++ b/core/contract/shield_contract.proto @@ -9,73 +9,73 @@ option go_package = "github.com/tronprotocol/grpc-gateway/core"; // for shielded transaction message AuthenticationPath { - repeated bool value = 1; + repeated bool value = 1; } message MerklePath { - repeated AuthenticationPath authentication_paths = 1; - repeated bool index = 2; - bytes rt = 3; + repeated AuthenticationPath authentication_paths = 1; + repeated bool index = 2; + bytes rt = 3; } message OutputPoint { - bytes hash = 1; - int32 index = 2; + bytes hash = 1; + int32 index = 2; } message OutputPointInfo { - repeated OutputPoint out_points = 1; - int32 block_num = 2; + repeated OutputPoint out_points = 1; + int32 block_num = 2; } message PedersenHash { - bytes content = 1; + bytes content = 1; } message IncrementalMerkleTree { - PedersenHash left = 1; - PedersenHash right = 2; - repeated PedersenHash parents = 3; + PedersenHash left = 1; + PedersenHash right = 2; + repeated PedersenHash parents = 3; } message IncrementalMerkleVoucher { - IncrementalMerkleTree tree = 1; - repeated PedersenHash filled = 2; - IncrementalMerkleTree cursor = 3; - int64 cursor_depth = 4; - bytes rt = 5; - OutputPoint output_point = 10; + IncrementalMerkleTree tree = 1; + repeated PedersenHash filled = 2; + IncrementalMerkleTree cursor = 3; + int64 cursor_depth = 4; + bytes rt = 5; + OutputPoint output_point = 10; } message IncrementalMerkleVoucherInfo { - repeated IncrementalMerkleVoucher vouchers = 1; - repeated bytes paths = 2; + repeated IncrementalMerkleVoucher vouchers = 1; + repeated bytes paths = 2; } message SpendDescription { - bytes value_commitment = 1; - bytes anchor = 2; // merkle root - bytes nullifier = 3; // used for check double spend - bytes rk = 4; // used for check spend authority signature - bytes zkproof = 5; - bytes spend_authority_signature = 6; + bytes value_commitment = 1; + bytes anchor = 2; // merkle root + bytes nullifier = 3; // used for check double spend + bytes rk = 4; // used for check spend authority signature + bytes zkproof = 5; + bytes spend_authority_signature = 6; } message ReceiveDescription { - bytes value_commitment = 1; - bytes note_commitment = 2; - bytes epk = 3; // for Encryption - bytes c_enc = 4; // Encryption for incoming, decrypt it with ivk - bytes c_out = 5; // Encryption for audit, decrypt it with ovk - bytes zkproof = 6; + bytes value_commitment = 1; + bytes note_commitment = 2; + bytes epk = 3; // for Encryption + bytes c_enc = 4; // Encryption for incoming, decrypt it with ivk + bytes c_out = 5; // Encryption for audit, decrypt it with ovk + bytes zkproof = 6; } message ShieldedTransferContract { - bytes transparent_from_address = 1; // transparent address - int64 from_amount = 2; - repeated SpendDescription spend_description = 3; - repeated ReceiveDescription receive_description = 4; - bytes binding_signature = 5; - bytes transparent_to_address = 6; // transparent address - int64 to_amount = 7; // the amount to transparent to_address + bytes transparent_from_address = 1; // transparent address + int64 from_amount = 2; + repeated SpendDescription spend_description = 3; + repeated ReceiveDescription receive_description = 4; + bytes binding_signature = 5; + bytes transparent_to_address = 6; // transparent address + int64 to_amount = 7; // the amount to transparent to_address } diff --git a/core/contract/smart_contract.proto b/core/contract/smart_contract.proto index 18cc9574b..4f09e76e6 100644 --- a/core/contract/smart_contract.proto +++ b/core/contract/smart_contract.proto @@ -9,86 +9,86 @@ option go_package = "github.com/tronprotocol/grpc-gateway/core"; import "core/Tron.proto"; message SmartContract { - message ABI { - message Entry { - enum EntryType { - UnknownEntryType = 0; - Constructor = 1; - Function = 2; - Event = 3; - Fallback = 4; - } - message Param { - bool indexed = 1; - string name = 2; - string type = 3; - // SolidityType type = 3; - } - enum StateMutabilityType { - UnknownMutabilityType = 0; - Pure = 1; - View = 2; - Nonpayable = 3; - Payable = 4; - } + message ABI { + message Entry { + enum EntryType { + UnknownEntryType = 0; + Constructor = 1; + Function = 2; + Event = 3; + Fallback = 4; + } + message Param { + bool indexed = 1; + string name = 2; + string type = 3; + // SolidityType type = 3; + } + enum StateMutabilityType { + UnknownMutabilityType = 0; + Pure = 1; + View = 2; + Nonpayable = 3; + Payable = 4; + } - bool anonymous = 1; - bool constant = 2; - string name = 3; - repeated Param inputs = 4; - repeated Param outputs = 5; - EntryType type = 6; - bool payable = 7; - StateMutabilityType stateMutability = 8; - } - repeated Entry entrys = 1; + bool anonymous = 1; + bool constant = 2; + string name = 3; + repeated Param inputs = 4; + repeated Param outputs = 5; + EntryType type = 6; + bool payable = 7; + StateMutabilityType stateMutability = 8; } - bytes origin_address = 1; - bytes contract_address = 2; - ABI abi = 3; - bytes bytecode = 4; - int64 call_value = 5; - int64 consume_user_resource_percent = 6; - string name = 7; - int64 origin_energy_limit = 8; - bytes code_hash = 9; - bytes trx_hash = 10; + repeated Entry entrys = 1; + } + bytes origin_address = 1; + bytes contract_address = 2; + ABI abi = 3; + bytes bytecode = 4; + int64 call_value = 5; + int64 consume_user_resource_percent = 6; + string name = 7; + int64 origin_energy_limit = 8; + bytes code_hash = 9; + bytes trx_hash = 10; } message CreateSmartContract { - bytes owner_address = 1; - SmartContract new_contract = 2; - int64 call_token_value = 3; - int64 token_id = 4; + bytes owner_address = 1; + SmartContract new_contract = 2; + int64 call_token_value = 3; + int64 token_id = 4; } message TriggerSmartContract { - bytes owner_address = 1; - bytes contract_address = 2; - int64 call_value = 3; - bytes data = 4; - int64 call_token_value = 5; - int64 token_id = 6; + bytes owner_address = 1; + bytes contract_address = 2; + int64 call_value = 3; + bytes data = 4; + int64 call_token_value = 5; + int64 token_id = 6; } message ClearABIContract { - bytes owner_address = 1; - bytes contract_address = 2; + bytes owner_address = 1; + bytes contract_address = 2; } message UpdateSettingContract { - bytes owner_address = 1; - bytes contract_address = 2; - int64 consume_user_resource_percent = 3; + bytes owner_address = 1; + bytes contract_address = 2; + int64 consume_user_resource_percent = 3; } message UpdateEnergyLimitContract { - bytes owner_address = 1; - bytes contract_address = 2; - int64 origin_energy_limit = 3; + bytes owner_address = 1; + bytes contract_address = 2; + int64 origin_energy_limit = 3; } message SmartContractDataWrapper { - SmartContract smart_contract = 1; - bytes runtimecode = 2; + SmartContract smart_contract = 1; + bytes runtimecode = 2; } \ No newline at end of file diff --git a/core/contract/storage_contract.proto b/core/contract/storage_contract.proto index 666e6b11f..f04bf716e 100644 --- a/core/contract/storage_contract.proto +++ b/core/contract/storage_contract.proto @@ -7,21 +7,21 @@ option java_package = "org.tron.protos.contract"; //Specify the name of the pack option go_package = "github.com/tronprotocol/grpc-gateway/core"; message BuyStorageBytesContract { - bytes owner_address = 1; - int64 bytes = 2; // storage bytes for buy + bytes owner_address = 1; + int64 bytes = 2; // storage bytes for buy } message BuyStorageContract { - bytes owner_address = 1; - int64 quant = 2; // trx quantity for buy storage (sun) + bytes owner_address = 1; + int64 quant = 2; // trx quantity for buy storage (sun) } message SellStorageContract { - bytes owner_address = 1; - int64 storage_bytes = 2; + bytes owner_address = 1; + int64 storage_bytes = 2; } message UpdateBrokerageContract { - bytes owner_address = 1; - int32 brokerage = 2; // 1 mean 1% + bytes owner_address = 1; + int32 brokerage = 2; // 1 mean 1% } diff --git a/core/contract/vote_asset_contract.proto b/core/contract/vote_asset_contract.proto index 522666e47..d3b8e5b77 100644 --- a/core/contract/vote_asset_contract.proto +++ b/core/contract/vote_asset_contract.proto @@ -7,8 +7,8 @@ option java_package = "org.tron.protos.contract"; //Specify the name of the pack option go_package = "github.com/tronprotocol/grpc-gateway/core"; message VoteAssetContract { - bytes owner_address = 1; - repeated bytes vote_address = 2; - bool support = 3; - int32 count = 5; -} + bytes owner_address = 1; + repeated bytes vote_address = 2; + bool support = 3; + int32 count = 5; +} \ No newline at end of file diff --git a/core/contract/witness_contract.proto b/core/contract/witness_contract.proto index 115a2128e..5021fbf9a 100644 --- a/core/contract/witness_contract.proto +++ b/core/contract/witness_contract.proto @@ -7,21 +7,21 @@ option java_package = "org.tron.protos.contract"; //Specify the name of the pack option go_package = "github.com/tronprotocol/grpc-gateway/core"; message WitnessCreateContract { - bytes owner_address = 1; - bytes url = 2; + bytes owner_address = 1; + bytes url = 2; } message WitnessUpdateContract { - bytes owner_address = 1; - bytes update_url = 12; + bytes owner_address = 1; + bytes update_url = 12; } message VoteWitnessContract { - message Vote { - bytes vote_address = 1; - int64 vote_count = 2; - } - bytes owner_address = 1; - repeated Vote votes = 2; - bool support = 3; -} + message Vote { + bytes vote_address = 1; + int64 vote_count = 2; + } + bytes owner_address = 1; + repeated Vote votes = 2; + bool support = 3; +} \ No newline at end of file