From ecfa9b1e7780232cfcbe9dc11f6180fab0e82985 Mon Sep 17 00:00:00 2001 From: anighanta Date: Mon, 14 Jun 2021 17:07:25 -0500 Subject: [PATCH 1/5] added messages for custom token fee type and custom hbar fee type Signed-off-by: anighanta --- services/BasicTypes.proto | 26 ++++++++++++++++++++++++++ services/TokenCreate.proto | 2 ++ services/TokenGetInfo.proto | 2 ++ services/TokenUpdate.proto | 2 ++ services/TransactionRecord.proto | 2 ++ 5 files changed, 34 insertions(+) diff --git a/services/BasicTypes.proto b/services/BasicTypes.proto index 2d7b4ee5..e0a11d44 100644 --- a/services/BasicTypes.proto +++ b/services/BasicTypes.proto @@ -99,6 +99,32 @@ message TokenTransferList { repeated NftTransfer nftTransfers = 3; // Applicable to tokens of type NON_FUNGIBLE_UNIQUE. Multiple list of NftTransfers, each of which has a sender and receiver account, including the serial number of the NFT } +/* A list of accounts and amounts that are involved in a Token's CustomTransferFeeInHbar*/ +message CustomHbarFees { + TransferList customHbarFees = 1; +} + +/* A list of tokenIds and amounts representing the transferred out (negative) or into (positive) amounts according to a Token's CustomTransferFeeInTokens*/ +message CustomTokenUnitFees { + repeated TokenTransferList customTokenUnitFees = 1; +} + +/* A Token's custom transfer fee in Token Units that needs to be paid to the specified receiver when a TokenTransfer is performed.*/ +message CustomTransferFeeInTokens { + TokenID token = 1; + sint64 amount = 2; + bool percentage = 3; + sint64 minAmount = 4; + AccountID receiverAccountID = 5; +} + +/* A Token's custom transfer fee in Hbar that needs to be paid to the specified receiver when a TokenTransfer is performed */ +message CustomTransferFeeInHbar { + sint64 amount = 1; + bool percentage = 2; + sint64 minAmount = 3; + AccountID receiverAccountID = 4; +} /* Unique identifier for a topic (used by the consensus service) */ message TopicID { int64 shardNum = 1; // The shard number (nonnegative) diff --git a/services/TokenCreate.proto b/services/TokenCreate.proto index fa4d4b28..f076cb5e 100644 --- a/services/TokenCreate.proto +++ b/services/TokenCreate.proto @@ -60,4 +60,6 @@ message TokenCreateTransactionBody { TokenType tokenType = 17; // IWA compatibility. Specifies the token type. Defaults to FUNGIBLE_COMMON TokenSupplyType supplyType = 18; // IWA compatibility. Specified the token supply type. Defaults to INFINITE int64 maxSupply = 19; // IWA Compatibility. Depends on TokenSupplyType. For tokens of type FUNGIBLE_COMMON - the maximum number of tokens that can be in circulation. For tokens of type NON_FUNGIBLE_UNIQUE - the maximum number of NFTs (serial numbers) that can be minted. This field can never be changed! + repeated CustomTransferFeeInTokens customFeeInTokens = 20; // Custom fee in Token Units that needs to be paid to the specified receiver on a TokenTransfer + repeated CustomTransferFeeInHbar customFeeInHbar = 21;// Custom fee in hbar that needs to be paid to the specified receiver on a TokenTransfer } diff --git a/services/TokenGetInfo.proto b/services/TokenGetInfo.proto index 9f2e5736..229448c4 100644 --- a/services/TokenGetInfo.proto +++ b/services/TokenGetInfo.proto @@ -60,6 +60,8 @@ message TokenInfo { TokenType tokenType = 19; // The token type TokenSupplyType supplyType = 20; // The token supply type int64 maxSupply = 21; // For tokens of type FUNGIBLE_COMMON - The Maximum number of fungible tokens that can be in circulation. For tokens of type NON_FUNGIBLE_UNIQUE - the maximum number of NFTs (serial numbers) that can be in circulation + repeated CustomTransferFeeInTokens customFeeInTokens = 22; // Custom fee in Token Units that needs to be paid to the specified receiver on a TokenTransfer + repeated CustomTransferFeeInHbar customFeeInHbar = 23;// Custom fee in hbar that needs to be paid to the specified receiver on a TokenTransfer } /* Response when the client sends the node TokenGetInfoQuery */ diff --git a/services/TokenUpdate.proto b/services/TokenUpdate.proto index a3baac71..9837bc29 100644 --- a/services/TokenUpdate.proto +++ b/services/TokenUpdate.proto @@ -53,4 +53,6 @@ message TokenUpdateTransactionBody { Duration autoRenewPeriod = 11; // The new interval at which the auto-renew account will be charged to extend the token's expiry. Timestamp expiry = 12; // The new expiry time of the token. Expiry can be updated even if admin key is not set. If the provided expiry is earlier than the current token expiry, transaction wil resolve to INVALID_EXPIRATION_TIME google.protobuf.StringValue memo = 13; // If set, the new memo to be associated with the token (UTF-8 encoding max 100 bytes) + repeated CustomTransferFeeInTokens customFeeInTokens = 14; // Custom fee in Token Units that needs to be paid to the specified receiver on a TokenTransfer + repeated CustomTransferFeeInHbar customFeeInHbar = 15;// Custom fee in hbar that needs to be paid to the specified receiver on a TokenTransfer } diff --git a/services/TransactionRecord.proto b/services/TransactionRecord.proto index 36f207f2..5e19aeab 100644 --- a/services/TransactionRecord.proto +++ b/services/TransactionRecord.proto @@ -46,4 +46,6 @@ message TransactionRecord { TransferList transferList = 10; // All hbar transfers as a result of this transaction, such as fees, or transfers performed by the transaction, or by a smart contract it calls, or by the creation of threshold records that it triggers. repeated TokenTransferList tokenTransferLists = 11; // All Token transfers as a result of this transaction ScheduleID scheduleRef = 12; // Reference to the scheduled transaction ID that this transaction record represent + CustomHbarFees customHbarFees = 13; // All hbar transfers as a result of the CustomTransferFeeInHbar of a Token - tokenTransfer + CustomTokenUnitFees customTokenUnitFees = 14; // All Token transfers as a result of CustomTransferFeeInTokens of a Token - tokenTransfer } From 477e874e4646a342eaa1311050738b6a4c32b7d7 Mon Sep 17 00:00:00 2001 From: anighanta Date: Tue, 4 Jan 2022 19:48:41 +0530 Subject: [PATCH 2/5] fix broken links in readMe Signed-off-by: anighanta --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 042e4f2d..dc73cd6a 100644 --- a/README.md +++ b/README.md @@ -9,31 +9,31 @@ from the _*.proto_ files in this repository: There are five primary service families, which inter-operate on entities controlled by one (or more) Ed25519 keypairs: -1. The [cryptocurrency service](services/CryptoService.proto), +1. The [cryptocurrency service](services/crypto_service.proto), for cryptocurrency accounts with transfers denominated in [hBar (ℏ)](https://help.hedera.com/hc/en-us/articles/360000674317-What-are-the-official-HBAR-cryptocurrency-denominations-). -2. The [consensus service](services/ConsensusService.proto), for +2. The [consensus service](services/consensus_ervice.proto), for fast and unbiased ordering of opaque binary messages exchanged on arbitrary topics. -3. The [smart contract service](services/SmartContractService.proto), for +3. The [smart contract service](services/smart_contract_service.proto), for execution of Solidity contract creations and calls; contract may both possess ℏ themselves and exchange it with non-contract accounts. -4. The [file service](services/FileService.proto), for storage and +4. The [file service](services/file_service.proto), for storage and retrieval of opaque binary data. -5. The [token service](services/TokenService.proto), for token related operations such as create, update, mint, burn, transfer etc. +5. The [token service](services/token_service.proto), for token related operations such as create, update, mint, burn, transfer etc. There are also three secondary service families: -1. The [network service](hedera/NetworkService.proto), for operations scoped +1. The [network service](hedera/network_service.proto), for operations scoped to the network or its constituent nodes rather user-controlled entities as above. -2. The [scheduling service](services/ScheduleService.proto), for scheduling a transaction to +2. The [scheduling service](services/schedule_service.proto), for scheduling a transaction to be executed when the ledger has received enough prequisite signatures. -3. The [freeze service](hedera/FreezeService.proto), for use by +3. The [freeze service](hedera/freeze_service.proto), for use by privileged accounts to suspend network operations during a maintenance window. It is important to note that most network services are gated by fees which must be paid in ℏ from a cryptocurrency account. The payer authorizes a fee by signing an appropriate transaction with a sufficient subset of the -Ed25519 key(s) associated to their account. +Ed25519/ECDSA_SECP256K1 key(s) associated to their account. # Branching This repository uses a simple branching model with only two distinguished branches: From 1dd27557811e3922741058c606559e9996621f88 Mon Sep 17 00:00:00 2001 From: anighanta Date: Tue, 4 Jan 2022 19:55:35 +0530 Subject: [PATCH 3/5] merge main Signed-off-by: anighanta --- mirror/ConsensusService.proto | 67 - mirror/consensus_service.proto | 100 ++ sdk/transaction_list.proto | 19 + services/BasicTypes.proto | 504 ------ services/ConsensusTopicInfo.proto | 56 - services/ConsensusUpdateTopic.proto | 71 - services/ContractCall.proto | 44 - services/ContractCallLocal.proto | 74 - services/ContractCreate.proto | 61 - services/ContractGetInfo.proto | 58 - services/ContractUpdate.proto | 61 - services/CryptoAddLiveHash.proto | 55 - services/CryptoCreate.proto | 50 - services/CryptoGetAccountBalance.proto | 49 - services/CryptoGetInfo.proto | 66 - services/CryptoGetStakers.proto | 53 - services/CryptoTransfer.proto | 36 - services/CryptoUpdate.proto | 56 - services/FileCreate.proto | 53 - services/FileGetContents.proto | 48 - services/FileGetInfo.proto | 52 - services/FileUpdate.proto | 41 - services/Freeze.proto | 40 - services/GetByKey.proto | 54 - services/GetBySolidityID.proto | 46 - services/NetworkGetVersionInfo.proto | 42 - services/NetworkService.proto | 36 - services/Query.proto | 93 -- services/QueryHeader.proto | 50 - services/Response.proto | 97 -- services/ResponseCode.proto | 240 --- services/ResponseHeader.proto | 38 - services/SchedulableTransactionBody.proto | 114 -- services/ScheduleCreate.proto | 67 - services/ScheduleGetInfo.proto | 69 - services/ScheduleService.proto | 59 - services/ScheduleSign.proto | 43 - services/SystemDelete.proto | 40 - services/ThrottleDefinitions.proto | 55 - services/TokenAssociate.proto | 42 - services/TokenBurn.proto | 40 - services/TokenCreate.proto | 65 - services/TokenDissociate.proto | 42 - services/TokenFreezeAccount.proto | 42 - services/TokenGetAccountNftInfo.proto | 46 - services/TokenGetInfo.proto | 71 - services/TokenGetNftInfo.proto | 55 - services/TokenGetNftInfos.proto | 47 - services/TokenGrantKyc.proto | 42 - services/TokenMint.proto | 40 - services/TokenRevokeKyc.proto | 42 - services/TokenService.proto | 67 - services/TokenUnfreezeAccount.proto | 42 - services/TokenUpdate.proto | 58 - services/TokenWipeAccount.proto | 48 - services/Transaction.proto | 39 - services/TransactionBody.proto | 129 -- services/TransactionGetFastRecord.proto | 42 - services/TransactionGetReceipt.proto | 44 - services/TransactionGetRecord.proto | 46 - services/TransactionReceipt.proto | 115 -- services/TransactionRecord.proto | 51 - services/basic_types.proto | 1468 +++++++++++++++++ ...pic.proto => consensus_create_topic.proto} | 55 +- ...pic.proto => consensus_delete_topic.proto} | 11 +- ...o.proto => consensus_get_topic_info.proto} | 41 +- ...sService.proto => consensus_service.proto} | 78 +- ...e.proto => consensus_submit_message.proto} | 42 +- services/consensus_topic_info.proto | 84 + services/consensus_update_topic.proto | 89 + services/contract_call.proto | 62 + services/contract_call_local.proto | 152 ++ services/contract_create.proto | 150 ++ ...ractDelete.proto => contract_delete.proto} | 35 +- ...code.proto => contract_get_bytecode.proto} | 38 +- services/contract_get_info.proto | 133 ++ ...cords.proto => contract_get_records.proto} | 44 +- services/contract_update.proto | 100 ++ services/crypto_add_live_hash.proto | 74 + services/crypto_create.proto | 133 ++ ...CryptoDelete.proto => crypto_delete.proto} | 19 +- ...sh.proto => crypto_delete_live_hash.proto} | 16 +- services/crypto_get_account_balance.proto | 82 + ...proto => crypto_get_account_records.proto} | 44 +- services/crypto_get_info.proto | 171 ++ ...eHash.proto => crypto_get_live_hash.proto} | 43 +- services/crypto_get_stakers.proto | 94 ++ ...yptoService.proto => crypto_service.proto} | 89 +- services/crypto_transfer.proto | 53 + services/crypto_update.proto | 132 ++ services/custom_fees.proto | 148 ++ services/{Duration.proto => duration.proto} | 9 +- ...ExchangeRate.proto => exchange_rate.proto} | 37 +- .../{FileAppend.proto => file_append.proto} | 21 +- services/file_create.proto | 102 ++ .../{FileDelete.proto => file_delete.proto} | 16 +- services/file_get_contents.proto | 76 + services/file_get_info.proto | 100 ++ .../{FileService.proto => file_service.proto} | 55 +- services/file_update.proto | 65 + services/freeze.proto | 82 + ...eezeService.proto => freeze_service.proto} | 15 +- services/freeze_type.proto | 70 + services/get_by_key.proto | 93 ++ services/get_by_solidity_id.proto | 75 + services/network_get_execution_time.proto | 67 + services/network_get_version_info.proto | 62 + services/network_service.proto | 56 + services/query.proto | 193 +++ services/query_header.proto | 75 + services/response.proto | 188 +++ services/response_code.proto | 1113 +++++++++++++ services/response_header.proto | 59 + services/schedulable_transaction_body.proto | 259 +++ services/schedule_create.proto | 93 ++ ...duleDelete.proto => schedule_delete.proto} | 22 +- services/schedule_get_info.proto | 129 ++ services/schedule_service.proto | 77 + services/schedule_sign.proto | 48 + ...ice.proto => smart_contract_service.proto} | 71 +- services/system_delete.proto | 56 + ...emUndelete.proto => system_undelete.proto} | 20 +- services/throttle_definitions.proto | 85 + services/{Timestamp.proto => timestamp.proto} | 25 +- services/token_associate.proto | 56 + services/token_burn.proto | 66 + services/token_create.proto | 202 +++ .../{TokenDelete.proto => token_delete.proto} | 19 +- services/token_dissociate.proto | 57 + services/token_fee_schedule_update.proto | 51 + services/token_freeze_account.proto | 53 + services/token_get_account_nft_infos.proto | 91 + services/token_get_info.proto | 211 +++ services/token_get_nft_info.proto | 104 ++ services/token_get_nft_infos.proto | 91 + services/token_grant_kyc.proto | 52 + services/token_mint.proto | 66 + services/token_pause.proto | 44 + services/token_revoke_kyc.proto | 52 + services/token_service.proto | 130 ++ services/token_unfreeze_account.proto | 54 + services/token_unpause.proto | 43 + services/token_update.proto | 146 ++ services/token_wipe_account.proto | 81 + services/transaction.proto | 68 + services/transaction_body.proto | 318 ++++ ...tents.proto => transaction_contents.proto} | 13 +- services/transaction_get_fast_record.proto | 70 + services/transaction_get_receipt.proto | 100 ++ services/transaction_get_record.proto | 100 ++ services/transaction_receipt.proto | 166 ++ services/transaction_record.proto | 125 ++ ...ponse.proto => transaction_response.proto} | 22 +- ...kedSubmit.proto => unchecked_submit.proto} | 12 +- streams/AccountBalanceFile.proto | 47 - streams/account_balance_file.proto | 79 + 156 files changed, 9797 insertions(+), 4298 deletions(-) delete mode 100644 mirror/ConsensusService.proto create mode 100644 mirror/consensus_service.proto create mode 100644 sdk/transaction_list.proto delete mode 100644 services/ConsensusTopicInfo.proto delete mode 100644 services/ConsensusUpdateTopic.proto delete mode 100644 services/ContractCall.proto delete mode 100644 services/ContractCallLocal.proto delete mode 100644 services/ContractCreate.proto delete mode 100644 services/ContractGetInfo.proto delete mode 100644 services/ContractUpdate.proto delete mode 100644 services/CryptoAddLiveHash.proto delete mode 100644 services/CryptoCreate.proto delete mode 100644 services/CryptoGetAccountBalance.proto delete mode 100644 services/CryptoGetInfo.proto delete mode 100644 services/CryptoGetStakers.proto delete mode 100644 services/CryptoTransfer.proto delete mode 100644 services/CryptoUpdate.proto delete mode 100644 services/FileCreate.proto delete mode 100644 services/FileGetContents.proto delete mode 100644 services/FileGetInfo.proto delete mode 100644 services/FileUpdate.proto delete mode 100644 services/Freeze.proto delete mode 100644 services/GetByKey.proto delete mode 100644 services/GetBySolidityID.proto delete mode 100644 services/NetworkGetVersionInfo.proto delete mode 100644 services/NetworkService.proto delete mode 100644 services/Query.proto delete mode 100644 services/QueryHeader.proto delete mode 100644 services/Response.proto delete mode 100644 services/ResponseCode.proto delete mode 100644 services/ResponseHeader.proto delete mode 100644 services/SchedulableTransactionBody.proto delete mode 100644 services/ScheduleCreate.proto delete mode 100644 services/ScheduleGetInfo.proto delete mode 100644 services/ScheduleService.proto delete mode 100644 services/ScheduleSign.proto delete mode 100644 services/SystemDelete.proto delete mode 100644 services/ThrottleDefinitions.proto delete mode 100644 services/TokenAssociate.proto delete mode 100644 services/TokenBurn.proto delete mode 100644 services/TokenCreate.proto delete mode 100644 services/TokenDissociate.proto delete mode 100644 services/TokenFreezeAccount.proto delete mode 100644 services/TokenGetAccountNftInfo.proto delete mode 100644 services/TokenGetInfo.proto delete mode 100644 services/TokenGetNftInfo.proto delete mode 100644 services/TokenGetNftInfos.proto delete mode 100644 services/TokenGrantKyc.proto delete mode 100644 services/TokenMint.proto delete mode 100644 services/TokenRevokeKyc.proto delete mode 100644 services/TokenService.proto delete mode 100644 services/TokenUnfreezeAccount.proto delete mode 100644 services/TokenUpdate.proto delete mode 100644 services/TokenWipeAccount.proto delete mode 100644 services/Transaction.proto delete mode 100644 services/TransactionBody.proto delete mode 100644 services/TransactionGetFastRecord.proto delete mode 100644 services/TransactionGetReceipt.proto delete mode 100644 services/TransactionGetRecord.proto delete mode 100644 services/TransactionReceipt.proto delete mode 100644 services/TransactionRecord.proto create mode 100644 services/basic_types.proto rename services/{ConsensusCreateTopic.proto => consensus_create_topic.proto} (55%) rename services/{ConsensusDeleteTopic.proto => consensus_delete_topic.proto} (83%) rename services/{ConsensusGetTopicInfo.proto => consensus_get_topic_info.proto} (60%) rename services/{ConsensusService.proto => consensus_service.proto} (63%) rename services/{ConsensusSubmitMessage.proto => consensus_submit_message.proto} (53%) create mode 100644 services/consensus_topic_info.proto create mode 100644 services/consensus_update_topic.proto create mode 100644 services/contract_call.proto create mode 100644 services/contract_call_local.proto create mode 100644 services/contract_create.proto rename services/{ContractDelete.proto => contract_delete.proto} (56%) rename services/{ContractGetBytecode.proto => contract_get_bytecode.proto} (53%) create mode 100644 services/contract_get_info.proto rename services/{ContractGetRecords.proto => contract_get_records.proto} (50%) create mode 100644 services/contract_update.proto create mode 100644 services/crypto_add_live_hash.proto create mode 100644 services/crypto_create.proto rename services/{CryptoDelete.proto => crypto_delete.proto} (61%) rename services/{CryptoDeleteLiveHash.proto => crypto_delete_live_hash.proto} (71%) create mode 100644 services/crypto_get_account_balance.proto rename services/{CryptoGetAccountRecords.proto => crypto_get_account_records.proto} (56%) create mode 100644 services/crypto_get_info.proto rename services/{CryptoGetLiveHash.proto => crypto_get_live_hash.proto} (51%) create mode 100644 services/crypto_get_stakers.proto rename services/{CryptoService.proto => crypto_service.proto} (53%) create mode 100644 services/crypto_transfer.proto create mode 100644 services/crypto_update.proto create mode 100644 services/custom_fees.proto rename services/{Duration.proto => duration.proto} (88%) rename services/{ExchangeRate.proto => exchange_rate.proto} (64%) rename services/{FileAppend.proto => file_append.proto} (57%) create mode 100644 services/file_create.proto rename services/{FileDelete.proto => file_delete.proto} (52%) create mode 100644 services/file_get_contents.proto create mode 100644 services/file_get_info.proto rename services/{FileService.proto => file_service.proto} (68%) create mode 100644 services/file_update.proto create mode 100644 services/freeze.proto rename services/{FreezeService.proto => freeze_service.proto} (72%) create mode 100644 services/freeze_type.proto create mode 100644 services/get_by_key.proto create mode 100644 services/get_by_solidity_id.proto create mode 100644 services/network_get_execution_time.proto create mode 100644 services/network_get_version_info.proto create mode 100644 services/network_service.proto create mode 100644 services/query.proto create mode 100644 services/query_header.proto create mode 100644 services/response.proto create mode 100644 services/response_code.proto create mode 100644 services/response_header.proto create mode 100644 services/schedulable_transaction_body.proto create mode 100644 services/schedule_create.proto rename services/{ScheduleDelete.proto => schedule_delete.proto} (58%) create mode 100644 services/schedule_get_info.proto create mode 100644 services/schedule_service.proto create mode 100644 services/schedule_sign.proto rename services/{SmartContractService.proto => smart_contract_service.proto} (62%) create mode 100644 services/system_delete.proto rename services/{SystemUndelete.proto => system_undelete.proto} (67%) create mode 100644 services/throttle_definitions.proto rename services/{Timestamp.proto => timestamp.proto} (59%) create mode 100644 services/token_associate.proto create mode 100644 services/token_burn.proto create mode 100644 services/token_create.proto rename services/{TokenDelete.proto => token_delete.proto} (60%) create mode 100644 services/token_dissociate.proto create mode 100644 services/token_fee_schedule_update.proto create mode 100644 services/token_freeze_account.proto create mode 100644 services/token_get_account_nft_infos.proto create mode 100644 services/token_get_info.proto create mode 100644 services/token_get_nft_info.proto create mode 100644 services/token_get_nft_infos.proto create mode 100644 services/token_grant_kyc.proto create mode 100644 services/token_mint.proto create mode 100644 services/token_pause.proto create mode 100644 services/token_revoke_kyc.proto create mode 100644 services/token_service.proto create mode 100644 services/token_unfreeze_account.proto create mode 100644 services/token_unpause.proto create mode 100644 services/token_update.proto create mode 100644 services/token_wipe_account.proto create mode 100644 services/transaction.proto create mode 100644 services/transaction_body.proto rename services/{TransactionContents.proto => transaction_contents.proto} (75%) create mode 100644 services/transaction_get_fast_record.proto create mode 100644 services/transaction_get_receipt.proto create mode 100644 services/transaction_get_record.proto create mode 100644 services/transaction_receipt.proto create mode 100644 services/transaction_record.proto rename services/{TransactionResponse.proto => transaction_response.proto} (51%) rename services/{UncheckedSubmit.proto => unchecked_submit.proto} (76%) delete mode 100644 streams/AccountBalanceFile.proto create mode 100644 streams/account_balance_file.proto diff --git a/mirror/ConsensusService.proto b/mirror/ConsensusService.proto deleted file mode 100644 index 13ac02cf..00000000 --- a/mirror/ConsensusService.proto +++ /dev/null @@ -1,67 +0,0 @@ -/*- - * ‌ - * Hedera Mirror Node - * ​ - * Copyright (C) 2019 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -syntax = "proto3"; - -package com.hedera.mirror.api.proto; - -option java_multiple_files = true; // Required for the reactor-grpc generator to work correctly -option java_package = "com.hedera.mirror.api.proto"; - -import "BasicTypes.proto"; -import "Timestamp.proto"; -import "ConsensusSubmitMessage.proto"; - -message ConsensusTopicQuery { - .proto.TopicID topicID = 1; // A required topic ID to retrieve messages for. - - // Include messages which reached consensus on or after this time. Defaults to current time if not set. - .proto.Timestamp consensusStartTime = 2; - - // Include messages which reached consensus before this time. If not set it will receive indefinitely. - .proto.Timestamp consensusEndTime = 3; - - // The maximum number of messages to receive before stopping. If not set or set to zero it will return messages - // indefinitely. - uint64 limit = 4; -} - -message ConsensusTopicResponse { - .proto.Timestamp consensusTimestamp = 1; // The time at which the transaction reached consensus - - // The message body originally in the ConsensusSubmitMessageTransactionBody. Message size will be less than 6KiB. - bytes message = 2; - - bytes runningHash = 3; // The running hash (SHA384) of every message. - - uint64 sequenceNumber = 4; // Starts at 1 for first submitted message. Incremented on each submitted message. - - uint64 runningHashVersion = 5; // Version of the SHA-384 digest used to update the running hash. - - .proto.ConsensusMessageChunkInfo chunkInfo = 6; // Optional information of the current chunk in a fragmented message. -} - -// -// The Mirror Service provides the ability to query a stream of Hedera Consensus Service (HCS) messages for an -// HCS Topic via a specific (possibly open-ended) time range. -// -service ConsensusService { - rpc subscribeTopic (ConsensusTopicQuery) returns (stream ConsensusTopicResponse); -} diff --git a/mirror/consensus_service.proto b/mirror/consensus_service.proto new file mode 100644 index 00000000..438633e2 --- /dev/null +++ b/mirror/consensus_service.proto @@ -0,0 +1,100 @@ +/*- + * ‌ + * Hedera Mirror Node + * ​ + * Copyright (C) 2019 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +syntax = "proto3"; + +package com.hedera.mirror.api.proto; + +/** + * Required for the reactor-grpc generator to work correctly + */ +option java_multiple_files = true; + +option java_package = "com.hedera.mirror.api.proto"; + +import "basic_types.proto"; +import "timestamp.proto"; +import "consensus_submit_message.proto"; + +message ConsensusTopicQuery { + /** + * A required topic ID to retrieve messages for. + */ + .proto.TopicID topicID = 1; + + /** + * Include messages which reached consensus on or after this time. Defaults to current time if + * not set. + */ + .proto.Timestamp consensusStartTime = 2; + + /** + * Include messages which reached consensus before this time. If not set it will receive + * indefinitely. + */ + .proto.Timestamp consensusEndTime = 3; + + /** + * The maximum number of messages to receive before stopping. If not set or set to zero it will + * return messages indefinitely. + */ + uint64 limit = 4; +} + +message ConsensusTopicResponse { + /** + * The time at which the transaction reached consensus + */ + .proto.Timestamp consensusTimestamp = 1; + + /** + * The message body originally in the ConsensusSubmitMessageTransactionBody. Message size will + * be less than 6KiB. + */ + bytes message = 2; + + /** + * The running hash (SHA384) of every message. + */ + bytes runningHash = 3; + + /** + * Starts at 1 for first submitted message. Incremented on each submitted message. + */ + uint64 sequenceNumber = 4; + + /** + * Version of the SHA-384 digest used to update the running hash. + */ + uint64 runningHashVersion = 5; + + /** + * Optional information of the current chunk in a fragmented message. + */ + .proto.ConsensusMessageChunkInfo chunkInfo = 6; +} + +/** + * The Mirror Service provides the ability to query a stream of Hedera Consensus Service (HCS) + * messages for an HCS Topic via a specific (possibly open-ended) time range. + */ +service ConsensusService { + rpc subscribeTopic (ConsensusTopicQuery) returns (stream ConsensusTopicResponse); +} diff --git a/sdk/transaction_list.proto b/sdk/transaction_list.proto new file mode 100644 index 00000000..91e17274 --- /dev/null +++ b/sdk/transaction_list.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package proto; + +option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_multiple_files = true; + +import "transaction.proto"; + +/** + * A simple protobuf wrapper to store a list of transactions. This is used by + * `Transaction.[from|to]Bytes()` in the SDKs. The reason the SDK needs a list of transactions is + * because it holds onto a transaction per node. So if a transaction is to be submitted to nodes 3 + * and 4 the SDK Transaction type would contain a list of 2 protobuf transactions, one for node 3 + * and one for node 4. + */ +message TransactionList { + repeated Transaction transaction_list = 1; +} diff --git a/services/BasicTypes.proto b/services/BasicTypes.proto index e0a11d44..e69de29b 100644 --- a/services/BasicTypes.proto +++ b/services/BasicTypes.proto @@ -1,504 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -import "Timestamp.proto"; - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -/* Each shard has a nonnegative shard number. Each realm within a given shard has a nonnegative realm number (that number might be reused in other shards). And each account, file, and smart contract instance within a given realm has a nonnegative number (which might be reused in other realms). Every account, file, and smart contract instance is within exactly one realm. So a FileID is a triplet of numbers, like 0.1.2 for entity number 2 within realm 1 within shard 0. Each realm maintains a single counter for assigning numbers, so if there is a file with ID 0.1.2, then there won't be an account or smart contract instance with ID 0.1.2. - - Everything is partitioned into realms so that each Solidity smart contract can access everything in just a single realm, locking all those entities while it's running, but other smart contracts could potentially run in other realms in parallel. So realms allow Solidity to be parallelized somewhat, even though the language itself assumes everything is serial. */ -message ShardID { - int64 shardNum = 1; //the shard number (nonnegative) -} - -/* The ID for a realm. Within a given shard, every realm has a unique ID. Each account, file, and contract instance belongs to exactly one realm. */ -message RealmID { - int64 shardNum = 1; //The shard number (nonnegative) - int64 realmNum = 2; //The realm number (nonnegative) -} - -/* The ID for an a cryptocurrency account */ -message AccountID { - int64 shardNum = 1; //The shard number (nonnegative) - int64 realmNum = 2; //The realm number (nonnegative) - int64 accountNum = 3; //A nonnegative account number unique within its realm -} - -/* The ID for a file */ -message FileID { - int64 shardNum = 1; //The shard number (nonnegative) - int64 realmNum = 2; //The realm number (nonnegative) - int64 fileNum = 3; //A nonnegative File number unique within its realm -} - -/* The ID for a smart contract instance */ -message ContractID { - int64 shardNum = 1; //The shard number (nonnegative) - int64 realmNum = 2; //The realm number (nonnegative) - int64 contractNum = 3; //A nonnegative number unique within its realm -} - -/* -The ID for a transaction. This is used for retrieving receipts and records for a transaction, for appending to a file right after creating it, for instantiating a smart contract with bytecode in a file just created, and internally by the network for detecting when duplicate transactions are submitted. A user might get a transaction processed faster by submitting it to N nodes, each with a different node account, but all with the same TransactionID. Then, the transaction will take effect when the first of all those nodes submits the transaction and it reaches consensus. The other transactions will not take effect. So this could make the transaction take effect faster, if any given node might be slow. However, the full transaction fee is charged for each transaction, so the total fee is N times as much if the transaction is sent to N nodes. -Applicable to Scheduled Transactions: -- The ID of a Scheduled Transaction has transactionValidStart and accountIDs inherited from the ScheduleCreate transaction that created it. That is to say that they are equal -- The scheduled property is true for Scheduled Transactions -- transactionValidStart, accountID and scheduled properties should be omitted -*/ -message TransactionID { - Timestamp transactionValidStart = 1; // The transaction is invalid if consensusTimestamp < transactionID.transactionStartValid - AccountID accountID = 2; // The Account ID that paid for this transaction - bool scheduled = 3; // Whether the Transaction is of type Scheduled or no -} - -/* An account, and the amount that it sends or receives during a cryptocurrency or token transfer. */ -message AccountAmount { - AccountID accountID = 1; // The Account ID that sends/receives cryptocurrency or tokens - sint64 amount = 2; // The amount of tinybars (for Crypto transfers) or in the lowest denomination (for Token transfers) that the account sends(negative) or receives(positive) -} - -/* A list of accounts and amounts to transfer out of each account (negative) or into it (positive). */ -message TransferList { - repeated AccountAmount accountAmounts = 1; // Multiple list of AccountAmount pairs, each of which has an account and an amount to transfer into it (positive) or out of it (negative) -} - -/* A sender account, a receiver account, and the serial number of an NFT of a Token with NON_FUNGIBLE_UNIQUE type. */ -message NftTransfer { - AccountID senderAccountID = 1; // The accountID of the sender - AccountID receiverAccountID = 2; // The accountID of the receiver - int64 serialNumber = 3; // The serial number of the NFT -} - -/* A list of token IDs and amounts representing the transferred out (negative) or into (positive) amounts, represented in the lowest denomination of the token */ -message TokenTransferList { - TokenID token = 1; // The ID of the token - repeated AccountAmount transfers = 2; // Applicable to tokens of type FUNGIBLE_COMMON. Multiple list of AccountAmounts, each of which has an account and amount - repeated NftTransfer nftTransfers = 3; // Applicable to tokens of type NON_FUNGIBLE_UNIQUE. Multiple list of NftTransfers, each of which has a sender and receiver account, including the serial number of the NFT -} - -/* A list of accounts and amounts that are involved in a Token's CustomTransferFeeInHbar*/ -message CustomHbarFees { - TransferList customHbarFees = 1; -} - -/* A list of tokenIds and amounts representing the transferred out (negative) or into (positive) amounts according to a Token's CustomTransferFeeInTokens*/ -message CustomTokenUnitFees { - repeated TokenTransferList customTokenUnitFees = 1; -} - -/* A Token's custom transfer fee in Token Units that needs to be paid to the specified receiver when a TokenTransfer is performed.*/ -message CustomTransferFeeInTokens { - TokenID token = 1; - sint64 amount = 2; - bool percentage = 3; - sint64 minAmount = 4; - AccountID receiverAccountID = 5; -} - -/* A Token's custom transfer fee in Hbar that needs to be paid to the specified receiver when a TokenTransfer is performed */ -message CustomTransferFeeInHbar { - sint64 amount = 1; - bool percentage = 2; - sint64 minAmount = 3; - AccountID receiverAccountID = 4; -} -/* Unique identifier for a topic (used by the consensus service) */ -message TopicID { - int64 shardNum = 1; // The shard number (nonnegative) - int64 realmNum = 2; // The realm number (nonnegative) - int64 topicNum = 3; // Unique topic identifier within a realm (nonnegative). -} - -/* Unique identifier for a token */ -message TokenID { - int64 shardNum = 1; // A nonnegative shard number - int64 realmNum = 2; // A nonnegative realm number - int64 tokenNum = 3; // A nonnegative token number -} - -/* Unique identifier for a Schedule */ -message ScheduleID { - int64 shardNum = 1; // A nonnegative shard number - int64 realmNum = 2; // A nonnegative realm number - int64 scheduleNum = 3; // A nonnegative schedule number -} - -/** - * Possible Token Types (IWA Compatibility). - * Apart from fungible and non-fungible, Tokens can have either a common or unique representation. This distinction might seem subtle, but it is important when considering - * how tokens can be traced and if they can have isolated and unique properties. - */ -enum TokenType { - /** - * Interchangeable value with one another, where any quantity of them has the same value as another equal quantity if they are in the same class. - * Share a single set of properties, not distinct from one another. Simply represented as a balance or quantity to a given Hedera account. - */ - FUNGIBLE_COMMON = 0; - /** - * Unique, not interchangeable with other tokens of the same type as they typically have different values. - * Individually traced and can carry unique properties (e.g. serial number). - */ - NON_FUNGIBLE_UNIQUE = 1; -} - - -/** - * Possible FeeData Object SubTypes. Supplementary to the main HederaFunctionality Type. - * When not explicitly specified, DEFAULT is used. - */ -enum SubType { - DEFAULT = 0; - TOKEN_FUNGIBLE_COMMON = 1; - TOKEN_NON_FUNGIBLE_UNIQUE = 2; -} - -/** - * Possible Token Supply Types (IWA Compatibility). - * Indicates how many tokens can have during its lifetime. - */ -enum TokenSupplyType { - INFINITE = 0; // Indicates that tokens of that type have an upper bound of Long.MAX_VALUE. - FINITE = 1; // Indicates that tokens of that type have an upper bound of maxSupply, provided on token creation. -} - -/* Possible Freeze statuses returned on TokenGetInfoQuery or CryptoGetInfoResponse in TokenRelationship */ -enum TokenFreezeStatus { - FreezeNotApplicable = 0; - Frozen = 1; - Unfrozen = 2; -} - -/* Possible KYC statuses returned on TokenGetInfoQuery or CryptoGetInfoResponse in TokenRelationship */ -enum TokenKycStatus { - KycNotApplicable = 0; - Granted = 1; - Revoked = 2; -} - -/* A Key can be a public key from one of the three supported systems (ed25519, RSA-3072, ECDSA with p384). Or, it can be the ID of a smart contract instance, which is authorized to act as if it had a key. If an account has an ed25519 key associated with it, then the corresponding private key must sign any transaction to transfer cryptocurrency out of it. And similarly for RSA and ECDSA. - * - * A Key can be a smart contract ID, which means that smart contract is to authorize operations as if it had signed with a key that it owned. The smart contract doesn't actually have a key, and doesn't actually sign a transaction. But it's as if a virtual transaction were created, and the smart contract signed it with a private key. - * - * A Key can be a "threshold key", which means a list of M keys, any N of which must sign in order for the threshold signature to be considered valid. The keys within a threshold signature may themselves be threshold signatures, to allow complex signature requirements. - * - *A Key can be a "key list" where all keys in the list must sign unless specified otherwise in the documentation for a specific transaction type (e.g. FileDeleteTransactionBody). Their use is dependent on context. For example, a Hedera file is created with a list of keys, where all of them must sign a transaction to create or modify the file, but only one of them is needed to sign a transaction to delete the file. So it's a single list that sometimes acts as a 1-of-M threshold key, and sometimes acts as an M-of-M threshold key. A key list is always an M-of-M, unless specified otherwise in documentation. A key list can have nested key lists or threshold keys. Nested key lists are always M-of-M. A key list can have repeated Ed25519 public keys, but all repeated keys are only required to sign once. - * - * A Key can contain a ThresholdKey or KeyList, which in turn contain a Key, so this mutual recursion would allow nesting arbitrarily deep. A ThresholdKey which contains a list of primitive keys (e.g., ed25519) has 3 levels: ThresholdKey -> KeyList -> Key. A KeyList which contains several primitive keys (e.g., ed25519) has 2 levels: KeyList -> Key. A Key with 2 levels of nested ThresholdKeys has 7 levels: Key -> ThresholdKey -> KeyList -> Key -> ThresholdKey -> KeyList -> Key. - * - * Each Key should not have more than 46 levels, which implies 15 levels of nested ThresholdKeys. Only ed25519 primitive keys are currently supported. - */ -message Key { - oneof key { - ContractID contractID = 1; // smart contract instance that is authorized as if it had signed with a key - bytes ed25519 = 2; // ed25519 public key bytes - bytes RSA_3072 = 3; // RSA-3072 public key bytes - bytes ECDSA_384 = 4; // ECDSA with the p-384 curve public key bytes - ThresholdKey thresholdKey = 5; // a threshold N followed by a list of M keys, any N of which are required to form a valid signature - KeyList keyList = 6; // A list of Keys of the Key type. - } -} - -/* A set of public keys that are used together to form a threshold signature. If the threshold is N and there are M keys, then this is an N of M threshold signature. If an account is associated with ThresholdKeys, then a transaction to move cryptocurrency out of it must be signed by a list of M signatures, where at most M-N of them are blank, and the other at least N of them are valid signatures corresponding to at least N of the public keys listed here. */ -message ThresholdKey { - uint32 threshold = 1; // A valid signature set must have at least this many signatures - KeyList keys = 2; // List of all the keys that can sign -} - -/* A list of keys that requires all keys (M-of-M) to sign unless otherwise specified in documentation. A KeyList may contain repeated keys, but all repeated keys are only required to sign once. */ -message KeyList { - repeated Key keys = 1; // list of keys -} - -/* A Signature corresponding to a Key. It is a sequence of bytes holding a public key signature from one of the three supported systems (ed25519, RSA-3072, ECDSA with p384). Or, it can be a list of signatures corresponding to a single threshold key. Or, it can be the ID of a smart contract instance, which is authorized to act as if it had a key. If an account has an ed25519 key associated with it, then the corresponding private key must sign any transaction to transfer cryptocurrency out of it. If it has a smart contract ID associated with it, then that smart contract is allowed to transfer cryptocurrency out of it. The smart contract doesn't actually have a key, and doesn't actually sign a transaction. But it's as if a virtual transaction were created, and the smart contract signed it with a private key. A key can also be a "threshold key", which means a list of M keys, any N of which must sign in order for the threshold signature to be considered valid. The keys within a threshold signature may themselves be threshold signatures, to allow complex signature requirements (this nesting is not supported in the currently, but will be supported in a future version of API). If a Signature message is missing the "signature" field, then this is considered to be a null signature. That is useful in cases such as threshold signatures, where some of the signatures can be null. - * The definition of Key uses mutual recursion, so it allows nesting that is arbitrarily deep. But the current API only accepts Key messages up to 3 levels deep, such as a list of threshold keys, each of which is a list of primitive keys. Therefore, the matching Signature will have the same limitation. This restriction may be relaxed in future versions of the API, to allow deeper nesting. - * This message is deprecated and succeeded by SignaturePair and SignatureMap messages. - */ -message Signature { - option deprecated = true; - oneof signature { - bytes contract = 1; // smart contract virtual signature (always length zero) - bytes ed25519 = 2; // ed25519 signature bytes - bytes RSA_3072 = 3; //RSA-3072 signature bytes - bytes ECDSA_384 = 4; //ECDSA p-384 signature bytes - ThresholdSignature thresholdSignature = 5; // A list of signatures for a single N-of-M threshold Key. This must be a list of exactly M signatures, at least N of which are non-null. - SignatureList signatureList = 6; // A list of M signatures, each corresponding to a Key in a KeyList of the same length. - } -} - -/* -A signature corresponding to a ThresholdKey. For an N-of-M threshold key, this is a list of M signatures, at least N of which must be non-null. -This message is deprecated and succeeded by SignaturePair and SignatureMap messages. -*/ -message ThresholdSignature { - option deprecated = true; - SignatureList sigs = 2; // for an N-of-M threshold key, this is a list of M signatures, at least N of which must be non-null -} - -/* -The signatures corresponding to a KeyList of the same length. -This message is deprecated and succeeded by SignaturePair and SignatureMap messages. -*/ -message SignatureList { - option deprecated = true; - repeated Signature sigs = 2; // each signature corresponds to a Key in the KeyList -} - -/* -The client may use any number of bytes from 0 to the whole length of the public key for pubKeyPrefix. -If 0 bytes is used, then it is assumed that only one public key is used to sign. Only ed25519 -keys and hence signatures are currently supported. */ -message SignaturePair { - bytes pubKeyPrefix = 1; // First few bytes of the public key - oneof signature { - bytes contract = 2; // smart contract virtual signature (always length zero) - bytes ed25519 = 3; // ed25519 signature - bytes RSA_3072 = 4; //RSA-3072 signature - bytes ECDSA_384 = 5; //ECDSA p-384 signature - } -} - -/* -A set of signatures corresponding to every unique public key used to sign a given transaction. If one public key matches more than one prefixes on the signature map, the transaction containing the map will fail immediately with the response code KEY_PREFIX_MISMATCH. -*/ -message SignatureMap { - repeated SignaturePair sigPair = 1; // Each signature pair corresponds to a unique Key required to sign the transaction. -} - -/* -The transactions and queries supported by Hedera Hashgraph. -*/ -enum HederaFunctionality { - NONE = 0; // UNSPECIFIED - Need to keep first value as unspecified because first element is ignored and not parsed (0 is ignored by parser) - CryptoTransfer = 1; // crypto transfer - CryptoUpdate = 2; // crypto update account - CryptoDelete = 3; // crypto delete account - // Add a livehash to a crypto account - CryptoAddLiveHash = 4; - // Delete a livehash from a crypto account - CryptoDeleteLiveHash = 5; - ContractCall = 6; // Smart Contract Call - ContractCreate = 7; // Smart Contract Create Contract - ContractUpdate = 8; // Smart Contract update contract - FileCreate = 9; // File Operation create file - FileAppend = 10; // File Operation append file - FileUpdate = 11; // File Operation update file - FileDelete = 12; // File Operation delete file - CryptoGetAccountBalance = 13; // crypto get account balance - CryptoGetAccountRecords = 14; // crypto get account record - CryptoGetInfo = 15; // Crypto get info - ContractCallLocal = 16; // Smart Contract Call - ContractGetInfo = 17; // Smart Contract get info - ContractGetBytecode = 18; // Smart Contract, get the byte code - GetBySolidityID = 19; // Smart Contract, get by solidity ID - GetByKey = 20; // Smart Contract, get by key - // Get a live hash from a crypto account - CryptoGetLiveHash = 21; - CryptoGetStakers = 22; // Crypto, get the stakers for the node - FileGetContents = 23; // File Operations get file contents - FileGetInfo = 24; // File Operations get the info of the file - TransactionGetRecord = 25; // Crypto get the transaction records - ContractGetRecords = 26; // Contract get the transaction records - CryptoCreate = 27; // crypto create account - SystemDelete = 28; // system delete file - SystemUndelete = 29; // system undelete file - ContractDelete = 30; // delete contract - Freeze = 31; // freeze - CreateTransactionRecord = 32; // Create Tx Record - CryptoAccountAutoRenew = 33; // Crypto Auto Renew - ContractAutoRenew = 34; // Contract Auto Renew - GetVersionInfo = 35; //Get Version - TransactionGetReceipt = 36; // Transaction Get Receipt - ConsensusCreateTopic = 50; // Create Topic - ConsensusUpdateTopic = 51; // Update Topic - ConsensusDeleteTopic = 52; // Delete Topic - ConsensusGetTopicInfo = 53; // Get Topic information - ConsensusSubmitMessage = 54; // Submit message to topic - UncheckedSubmit = 55; - TokenCreate = 56; // Create Token - TokenGetInfo = 58; // Get Token information - TokenFreezeAccount = 59; // Freeze Account - TokenUnfreezeAccount = 60; // Unfreeze Account - TokenGrantKycToAccount = 61; // Grant KYC to Account - TokenRevokeKycFromAccount = 62; // Revoke KYC from Account - TokenDelete = 63; // Delete Token - TokenUpdate = 64; // Update Token - TokenMint = 65; // Mint tokens to treasury - TokenBurn = 66; // Burn tokens from treasury - TokenAccountWipe = 67; // Wipe token amount from Account holder - TokenAssociateToAccount = 68; // Associate tokens to an account - TokenDissociateFromAccount = 69; // Dissociate tokens from an account - ScheduleCreate = 70; // Create Scheduled Transaction - ScheduleDelete = 71; // Delete Scheduled Transaction - ScheduleSign = 72; // Sign Scheduled Transaction - ScheduleGetInfo = 73; // Get Scheduled Transaction Information - TokenGetAccountNftInfo = 74; // Get Token Account Nft Information - TokenGetNftInfo = 75; // Get Token Nft Information - TokenGetNftInfos = 76; // Get Token Nft List Information -} - -/* -A set of prices the nodes use in determining transaction and query fees, and constants involved in fee calculations. -Nodes multiply the amount of resources consumed by a transaction or query by the corresponding price to calculate the -appropriate fee. Units are one-thousandth of a tinyCent.*/ -message FeeComponents { - int64 min = 1; // A minimum, the calculated fee must be greater than this value - int64 max = 2; // A maximum, the calculated fee must be less than this value - int64 constant = 3; // A constant contribution to the fee - int64 bpt = 4; // The price of bandwidth consumed by a transaction, measured in bytes - int64 vpt = 5; // The price per signature verification for a transaction - int64 rbh = 6; // The price of RAM consumed by a transaction, measured in byte-hours - int64 sbh = 7; // The price of storage consumed by a transaction, measured in byte-hours - int64 gas = 8; // The price of computation for a smart contract transaction, measured in gas - int64 tv = 9; // The price per hbar transferred for a transfer - int64 bpr = 10; // The price of bandwidth for data retrieved from memory for a response, measured in bytes - int64 sbpr = 11; // The price of bandwidth for data retrieved from disk for a response, measured in bytes -} - -/* The fees for a specific transaction or query based on the fee data. */ -message TransactionFeeSchedule { - // A particular transaction or query - HederaFunctionality hederaFunctionality = 1; - // Resource price coefficients - FeeData feeData = 2 [deprecated=true]; - // Resource price coefficients. Supports subtype price definition. - repeated FeeData fees = 3; -} - -/* -The total fee charged for a transaction. It is composed of three components – a node fee that compensates the specific node that submitted the transaction, a network fee that compensates the network for assigning the transaction a consensus timestamp, and a service fee that compensates the network for the ongoing maintenance of the consequences of the transaction. -*/ -message FeeData { - // Fee paid to the submitting node - FeeComponents nodedata = 1; - // Fee paid to the network for processing a transaction into consensus - FeeComponents networkdata = 2; - // Fee paid to the network for providing the service associated with the transaction; for instance, storing a file - FeeComponents servicedata = 3; - // SubType distinguishing between different types of FeeData, correlating to the same HederaFunctionality - SubType subType = 4; -} - -/* -A list of resource prices fee for different transactions and queries and the time period at which this fee schedule will expire. Nodes use the prices to determine the fees for all transactions based on how much of those resources each transaction uses. -*/ -message FeeSchedule { - // List of price coefficients for network resources - repeated TransactionFeeSchedule transactionFeeSchedule = 1; - // FeeSchedule expiry time - TimestampSeconds expiryTime = 2; -} - -/* This contains two Fee Schedules with expiry timestamp. */ -message CurrentAndNextFeeSchedule { - FeeSchedule currentFeeSchedule = 1; // Contains current Fee Schedule - FeeSchedule nextFeeSchedule = 2; // Contains next Fee Schedule -} - -/* -Contains the IP address and the port representing a service endpoint of a Node in a network. Used to reach the Hedera API and submit transactions to the network. -*/ -message ServiceEndpoint { - bytes ipAddressV4 = 1; // The 32-bit IPv4 address of the node encoded in left to right order (e.g. 127.0.0.1 has 127 as its first byte) - int32 port = 2; // The port of the node -} - -/* -The data about a node, including its service endpoints and the Hedera account to be paid for services -provided by the node (that is, queries answered and transactions submitted.) - -If the serviceEndpoint list is not set, or empty, then the endpoint given by the (deprecated) -ipAddress and portno fields should be used. - -All fields are populated in the 0.0.102 address book file while only fields that start with # are populated in the 0.0.101 address book file. -*/ -message NodeAddress { - bytes ipAddress = 1 [deprecated=true]; // The IP address of the Node with separator & octets encoded in UTF-8. Usage is deprecated, ServiceEndpoint is preferred to retrieve a node's list of IP addresses and ports - int32 portno = 2 [deprecated=true]; // The port number of the grpc server for the node. Usage is deprecated, ServiceEndpoint is preferred to retrieve a node's list of IP addresses and ports - bytes memo = 3 [deprecated=true]; // Usage is deprecated, nodeAccountId is preferred to retrieve a node's account ID - string RSA_PubKey = 4; // The node's hex-encoded X509 RSA public key - int64 nodeId = 5; // # A non-sequential identifier for the node - AccountID nodeAccountId = 6; // # The account to be paid for queries and transactions sent to this node - bytes nodeCertHash = 7; // # The hex-encoded SHA-384 hash of the X509 cert used to encrypt gRPC traffic to the node - repeated ServiceEndpoint serviceEndpoint = 8; // # A node's service IP addresses and ports - string description = 9; // A description of the node, with UTF-8 encoding up to 100 bytes - int64 stake = 10; // The amount of tinybars staked to the node -} - -/* -A list of nodes and their metadata that contains all details of the nodes for the network. - -Used to parse the contents of system files 0.0.101 and 0.0.102. -*/ -message NodeAddressBook { - repeated NodeAddress nodeAddress = 1; // Metadata of all nodes in the network -} - -/* Hedera follows semantic versioning (https://semver.org/) for both the HAPI protobufs and the Services software. -This type allows the getVersionInfo query in the NetworkService to return the deployed versions -of both protobufs and software on the node answering the query. */ -message SemanticVersion { - int32 major = 1; // Increases with incompatible API changes - int32 minor = 2; // Increases with backwards-compatible new functionality - int32 patch = 3; // Increases with backwards-compatible bug fixes - string pre = 4; // A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers (https://semver.org/#spec-item-9); so given a semver 0.14.0-alpha.1+21AF26D3, this field would contain 'alpha.1' - string build = 5; // Build metadata MAY be denoted by appending a plus sign and a series of dot separated identifiers immediately following the patch or pre-release version (https://semver.org/#spec-item-10); so given a semver 0.14.0-alpha.1+21AF26D3, this field would contain '21AF26D3' -} - -message Setting { - string name = 1; // name of the property - string value = 2; // value of the property - bytes data = 3; // any data associated with property -} - -message ServicesConfigurationList { - repeated Setting nameValue = 1; // list of name value pairs of the application properties -} - -/* Token's information related to the given Account */ -message TokenRelationship { - TokenID tokenId = 1; // The ID of the token - string symbol = 2; // The Symbol of the token - uint64 balance = 3; // For token of type FUNGIBLE_COMMON - the balance that the Account holds in the smallest denomination. For token of type NON_FUNGIBLE_UNIQUE - the number of NFTs held by the account - TokenKycStatus kycStatus = 4; // The KYC status of the account (KycNotApplicable, Granted or Revoked). If the token does not have KYC key, KycNotApplicable is returned - TokenFreezeStatus freezeStatus = 5; // The Freeze status of the account (FreezeNotApplicable, Frozen or Unfrozen). If the token does not have Freeze key, FreezeNotApplicable is returned - uint32 decimals = 6; // Tokens divide into 10decimals pieces -} - -/* A number of transferable units of a certain token. - -The transferable unit of a token is its smallest denomination, as given by the token's decimals property---each minted token contains 10decimals transferable units. For example, we could think of the cent as the transferable unit of the US dollar (decimals=2); and the tinybar as the transferable unit of hbar (decimals=8). - -Transferable units are not directly comparable across different tokens. */ -message TokenBalance { - TokenID tokenId = 1; // A unique token id - uint64 balance = 2; // Number of transferable units of the identified token. For token of type FUNGIBLE_COMMON - balance in the smallest denomination. For token of type NON_FUNGIBLE_UNIQUE - the number of NFTs held by the account - uint32 decimals = 3; // Tokens divide into 10decimals pieces -} - -/* A sequence of token balances */ -message TokenBalances { - repeated TokenBalance tokenBalances = 1; -} diff --git a/services/ConsensusTopicInfo.proto b/services/ConsensusTopicInfo.proto deleted file mode 100644 index cb9030e1..00000000 --- a/services/ConsensusTopicInfo.proto +++ /dev/null @@ -1,56 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "Duration.proto"; -import "Timestamp.proto"; - -// Current state of a topic. -message ConsensusTopicInfo { - string memo = 1; // The memo associated with the topic (UTF-8 encoding max 100 bytes) - - // When a topic is created, its running hash is initialized to 48 bytes of binary zeros. - // For each submitted message, the topic's running hash is then updated to the output - // of a particular SHA-384 digest whose input data include the previous running hash. - // - // See the TransactionReceipt.proto documentation for an exact description of the - // data included in the SHA-384 digest used for the update. - bytes runningHash = 2; - - // Sequence number (starting at 1 for the first submitMessage) of messages on the topic. - uint64 sequenceNumber = 3; - - // Effective consensus timestamp at (and after) which submitMessage calls will no longer succeed on the topic - // and the topic will expire and after AUTORENEW_GRACE_PERIOD be automatically deleted. - Timestamp expirationTime = 4; - - Key adminKey = 5; // Access control for update/delete of the topic. Null if there is no key. - Key submitKey = 6; // Access control for ConsensusService.submitMessage. Null if there is no key. - - Duration autoRenewPeriod = 7; // If an auto-renew account is specified, when the topic expires, its lifetime will be extended by up to this duration (depending on the solvency of the auto-renew account). If the auto-renew account has no funds at all, the topic will be deleted instead. - AccountID autoRenewAccount = 8; // The account, if any, to charge for automatic renewal of the topic's lifetime upon expiry. -} diff --git a/services/ConsensusUpdateTopic.proto b/services/ConsensusUpdateTopic.proto deleted file mode 100644 index f2e1138e..00000000 --- a/services/ConsensusUpdateTopic.proto +++ /dev/null @@ -1,71 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "google/protobuf/wrappers.proto"; -import "BasicTypes.proto"; -import "Duration.proto"; -import "Timestamp.proto"; - -// All fields left null will not be updated. -// See [ConsensusService.updateTopic()](#proto.ConsensusService) -message ConsensusUpdateTopicTransactionBody { - TopicID topicID = 1; - - google.protobuf.StringValue memo = 2; // If set, the new memo to be associated with the topic (UTF-8 encoding max 100 bytes) - - // Effective consensus timestamp at (and after) which all consensus transactions and queries will fail. - // The expirationTime may be no longer than MAX_AUTORENEW_PERIOD (8000001 seconds) from the consensus timestamp of - // this transaction. - // On topics with no adminKey, extending the expirationTime is the only updateTopic option allowed on the topic. - // If unspecified, no change. - Timestamp expirationTime = 4; - - // Access control for update/delete of the topic. - // If unspecified, no change. - // If empty keyList - the adminKey is cleared. - Key adminKey = 6; - - // Access control for ConsensusService.submitMessage. - // If unspecified, no change. - // If empty keyList - the submitKey is cleared. - Key submitKey = 7; - - // The amount of time to extend the topic's lifetime automatically at expirationTime if the autoRenewAccount is - // configured and has funds (once autoRenew functionality is supported by HAPI). - // Limited to between MIN_AUTORENEW_PERIOD (6999999 seconds) and MAX_AUTORENEW_PERIOD (8000001 seconds) by - // servers-side configuration (which may change). - // If unspecified, no change. - Duration autoRenewPeriod = 8; - - // Optional account to be used at the topic's expirationTime to extend the life of the topic. - // Once autoRenew functionality is supported by HAPI, the topic lifetime will be extended up to a maximum of the - // autoRenewPeriod or however long the topic can be extended using all funds on the account (whichever is the - // smaller duration/amount). - // If specified as the default value (0.0.0), the autoRenewAccount will be removed. - // If unspecified, no change. - AccountID autoRenewAccount = 9; -} diff --git a/services/ContractCall.proto b/services/ContractCall.proto deleted file mode 100644 index 67e0bb91..00000000 --- a/services/ContractCall.proto +++ /dev/null @@ -1,44 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -/* -Call a function of the given smart contract instance, giving it functionParameters as its inputs. -The call can use at maximum the given amount of gas – the paying account will not be charged for any unspent gas. - -If this function results in data being stored, an amount of gas is calculated that reflects this storage burden. - -The amount of gas used, as well as other attributes of the transaction, e.g. size, number of signatures to be verified, -determine the fee for the transaction – which is charged to the paying account. -*/ - -message ContractCallTransactionBody { - ContractID contractID = 1; // the contract instance to call, in the format used in transactions - int64 gas = 2; // the maximum amount of gas to use for the call - int64 amount = 3; // number of tinybars sent (the function must be payable if this is nonzero) - bytes functionParameters = 4; // which function to call, and the parameters to pass to the function -} diff --git a/services/ContractCallLocal.proto b/services/ContractCallLocal.proto deleted file mode 100644 index cfb63c5a..00000000 --- a/services/ContractCallLocal.proto +++ /dev/null @@ -1,74 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; - -/* The log information for an event returned by a smart contract function call. One function call may return several such events. */ -message ContractLoginfo { - ContractID contractID = 1; // address of a contract that emitted the event - bytes bloom = 2; // bloom filter for a particular log - repeated bytes topic = 3; // topics of a particular event - bytes data = 4; // event data -} - -/* The result returned by a call to a smart contract function. This is part of the response to a ContractCallLocal query, and is in the record for a ContractCall or ContractCreateInstance transaction. The ContractCreateInstance transaction record has the results of the call to the constructor. */ -message ContractFunctionResult { - ContractID contractID = 1; // the smart contract instance whose function was called - bytes contractCallResult = 2; // the result returned by the function - string errorMessage = 3; // message In case there was an error during smart contract execution - bytes bloom = 4; // bloom filter for record - uint64 gasUsed = 5; // units of gas used to execute contract - repeated ContractLoginfo logInfo = 6; // the log info for events returned by the function - repeated ContractID createdContractIDs = 7; // the list of smart contracts that were created by the function call -} - -/* -Call a function of the given smart contract instance, giving it functionParameters as its inputs. -This is performed locally on the particular node that the client is communicating with. -It cannot change the state of the contract instance (and so, cannot spend anything from the instance's cryptocurrency account). -It will not have a consensus timestamp. It cannot generate a record or a receipt. The response will contain the output -returned by the function call. This is useful for calling getter functions, which purely read the state and don't change it. -It is faster and cheaper than a normal call, because it is purely local to a single node. - -Unlike a ContractCall transaction, the node will consume the entire amount of provided gas in determining -the fee for this query. -*/ -message ContractCallLocalQuery { - QueryHeader header = 1; // standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). The payment must cover the fees and all of the gas offered. - ContractID contractID = 2; // the contract instance to call, in the format used in transactions - int64 gas = 3; // The amount of gas to use for the call; all of the gas offered will be used and charged a corresponding fee - bytes functionParameters = 4; // which function to call, and the parameters to pass to the function - int64 maxResultSize = 5; // max number of bytes that the result might include. The run will fail if it would have returned more than this number of bytes. -} - -/* Response when the client sends the node ContractCallLocalQuery */ -message ContractCallLocalResponse { - ResponseHeader header = 1; //standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - ContractFunctionResult functionResult = 2; // the value returned by the function (if it completed and didn't fail) -} diff --git a/services/ContractCreate.proto b/services/ContractCreate.proto deleted file mode 100644 index 2b51c07b..00000000 --- a/services/ContractCreate.proto +++ /dev/null @@ -1,61 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; -import "BasicTypes.proto"; -import "Duration.proto"; -/* -Start a new smart contract instance. After the instance is created, the ContractID for it is in the receipt, and can be -retrieved by the Record or with a GetByKey query. The instance will run the bytecode stored in a previously created -file, referenced either by FileID or by the transaction ID of the transaction that created the file - - -The constructor will be executed using the given amount of gas, and any unspent gas will be refunded to the paying account. Constructor inputs come from the given constructorParameters. - * - * The instance will exist for autoRenewPeriod seconds. When that is reached, it will renew itself for another autoRenewPeriod seconds by charging its associated cryptocurrency account (which it creates here). If it has insufficient cryptocurrency to extend that long, it will extend as long as it can. If its balance is zero, the instance will be deleted. - * - * A smart contract instance normally enforces rules, so "the code is law". For example, an ERC-20 contract prevents a transfer from being undone without a signature by the recipient of the transfer. This is always enforced if the contract instance was created with the adminKeys being null. But for some uses, it might be desirable to create something like an ERC-20 contract that has a specific group of trusted individuals who can act as a "supreme court" with the ability to override the normal operation, when a sufficient number of them agree to do so. If adminKeys is not null, then they can sign a transaction that can change the state of the smart contract in arbitrary ways, such as to reverse a transaction that violates some standard of behavior that is not covered by the code itself. The admin keys can also be used to change the autoRenewPeriod, and change the adminKeys field itself. The API currently does not implement this ability. But it does allow the adminKeys field to be set and queried, and will in the future implement such admin abilities for any instance that has a non-null adminKeys. - * - * If this constructor stores information, it is charged gas to store it. There is a fee in hbars to maintain that storage until the expiration time, and that fee is added as part of the transaction fee. - * - * An entity (account, file, or smart contract instance) must be created in a particular realm. If the realmID is left null, then a new realm will be created with the given admin key. If a new realm has a null adminKey, then anyone can create/modify/delete entities in that realm. But if an admin key is given, then any transaction to create/modify/delete an entity in that realm must be signed by that key, though anyone can still call functions on smart contract instances that exist in that realm. A realm ceases to exist when everything within it has expired and no longer exists. - * - * The current API ignores shardID, realmID, and newRealmAdminKey, and creates everything in shard 0 and realm 0, with a null key. Future versions of the API will support multiple realms and multiple shards. - * - * The optional memo field can contain a string whose length is up to 100 bytes. That is the size after Unicode NFD then UTF-8 conversion. This field can be used to describe the smart contract. It could also be used for other purposes. One recommended purpose is to hold a hexadecimal string that is the SHA-384 hash of a PDF file containing a human-readable legal contract. Then, if the admin keys are the public keys of human arbitrators, they can use that legal document to guide their decisions during a binding arbitration tribunal, convened to consider any changes to the smart contract in the future. The memo field can only be changed using the admin keys. If there are no admin keys, then it cannot be changed after the smart contract is created. - */ -message ContractCreateTransactionBody { - FileID fileID = 1; // the file containing the smart contract byte code. A copy will be made and held by the contract instance, and have the same expiration time as the instance. The file is referenced one of two ways: - Key adminKey = 3; // the state of the instance and its fields can be modified arbitrarily if this key signs a transaction to modify it. If this is null, then such modifications are not possible, and there is no administrator that can override the normal operation of this smart contract instance. Note that if it is created with no admin keys, then there is no administrator to authorize changing the admin keys, so there can never be any admin keys for that instance. - int64 gas = 4; // gas to run the constructor - int64 initialBalance = 5; // initial number of tinybars to put into the cryptocurrency account associated with and owned by the smart contract - AccountID proxyAccountID = 6; // ID of the account to which this account is proxy staked. If proxyAccountID is null, or is an invalid account, or is an account that isn't a node, then this account is automatically proxy staked to a node chosen by the network, but without earning payments. If the proxyAccountID account refuses to accept proxy staking , or if it is not currently running a node, then it will behave as if proxyAccountID was null. - Duration autoRenewPeriod = 8; // the instance will charge its account every this many seconds to renew for this long - bytes constructorParameters = 9; // parameters to pass to the constructor - ShardID shardID = 10; // shard in which to create this - RealmID realmID = 11; // realm in which to create this (leave this null to create a new realm) - Key newRealmAdminKey = 12; // if realmID is null, then this the admin key for the new realm that will be created - string memo = 13; // the memo that was submitted as part of the contract (max 100 bytes) -} diff --git a/services/ContractGetInfo.proto b/services/ContractGetInfo.proto deleted file mode 100644 index 23215e70..00000000 --- a/services/ContractGetInfo.proto +++ /dev/null @@ -1,58 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "Timestamp.proto"; -import "Duration.proto"; -import "BasicTypes.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; - -/* Get information about a smart contract instance. This includes the account that it uses, the file containing its bytecode, and the time when it will expire. */ -message ContractGetInfoQuery { - QueryHeader header = 1; // standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). - ContractID contractID = 2; // the contract for which information is requested -} - -/* Response when the client sends the node ContractGetInfoQuery */ -message ContractGetInfoResponse { - ResponseHeader header = 1; //standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - message ContractInfo { - ContractID contractID = 1; // ID of the contract instance, in the format used in transactions - AccountID accountID = 2; // ID of the cryptocurrency account owned by the contract instance, in the format used in transactions - string contractAccountID = 3; // ID of both the contract instance and the cryptocurrency account owned by the contract instance, in the format used by Solidity - Key adminKey = 4; // the state of the instance and its fields can be modified arbitrarily if this key signs a transaction to modify it. If this is null, then such modifications are not possible, and there is no administrator that can override the normal operation of this smart contract instance. Note that if it is created with no admin keys, then there is no administrator to authorize changing the admin keys, so there can never be any admin keys for that instance. */ - Timestamp expirationTime = 5; // the current time at which this contract instance (and its account) is set to expire - Duration autoRenewPeriod = 6; // the expiration time will extend every this many seconds. If there are insufficient funds, then it extends as long as possible. If the account is empty when it expires, then it is deleted. - int64 storage = 7; // number of bytes of storage being used by this instance (which affects the cost to extend the expiration time) - string memo = 8; // the memo associated with the contract (max 100 bytes) - uint64 balance = 9; // The current balance, in tinybars - bool deleted = 10; // Whether the contract has been deleted - repeated TokenRelationship tokenRelationships = 11; // The tokens associated to the contract - } - ContractInfo contractInfo = 2; // the information about this contract instance (a state proof can be generated for this) -} - diff --git a/services/ContractUpdate.proto b/services/ContractUpdate.proto deleted file mode 100644 index 1e3da371..00000000 --- a/services/ContractUpdate.proto +++ /dev/null @@ -1,61 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "Duration.proto"; -import "Timestamp.proto"; -import "google/protobuf/wrappers.proto"; - -/* -At consensus, updates the fields of a smart contract to the given values. - -If no value is given for a field, that field is left unchanged on the contract. For an immutable smart contract (that is, a contract created without an adminKey), only the expirationTime may be updated; setting any other field in this case will cause the transaction status to resolve to MODIFYING_IMMUTABLE_CONTRACT. - ---- Signing Requirements --- -1. Whether or not a contract has an admin Key, its expiry can be extended with only the transaction payer's signature. -2. Updating any other field of a mutable contract requires the admin key's signature. -3. If the update transaction includes a new admin key, this new key must also sign unless it is exactly an empty KeyList. This special sentinel key removes the existing admin key and causes the contract to become immutable. (Other Key structures without a constituent Ed25519 key will be rejected with INVALID_ADMIN_KEY.) */ -message ContractUpdateTransactionBody { - // The id of the contract to be updated - ContractID contractID = 1; - // The new expiry of the contract, no earlier than the current expiry (resolves to EXPIRATION_REDUCTION_NOT_ALLOWED otherwise) - Timestamp expirationTime = 2; - // The new key to control updates to the contract - Key adminKey = 3; - // (NOT YET IMPLEMENTED) The new id of the account to which the contract is proxy staked - AccountID proxyAccountID = 6; - // (NOT YET IMPLEMENTED) The new interval at which the contract will pay to extend its expiry (by the same interval) - Duration autoRenewPeriod = 7; - // The new id of the file asserted to contain the bytecode of the Solidity transaction that created this contract - FileID fileID = 8; - // The new contract memo, assumed to be Unicode encoded with UTF-8 (at most 100 bytes) - oneof memoField { - string memo = 9 [deprecated = true]; // [Deprecated] If set with a non-zero length, the new memo to be associated with the account (UTF-8 encoding max 100 bytes) - google.protobuf.StringValue memoWrapper = 10; // If set, the new memo to be associated with the account (UTF-8 encoding max 100 bytes) - } -} - diff --git a/services/CryptoAddLiveHash.proto b/services/CryptoAddLiveHash.proto deleted file mode 100644 index 04aec68c..00000000 --- a/services/CryptoAddLiveHash.proto +++ /dev/null @@ -1,55 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - - -import "BasicTypes.proto"; -import "Duration.proto"; - -/* A hash---presumably of some kind of credential or certificate---along with a list of keys, each of which may be either a primitive or a threshold key. */ -message LiveHash { - // The account to which the livehash is attached - AccountID accountId = 1; - // The SHA-384 hash of a credential or certificate - bytes hash = 2; - // A list of keys (primitive or threshold), all of which must sign to attach the livehash to an account, and any one of which can later delete it. - KeyList keys = 3; - // The duration for which the livehash will remain valid - Duration duration = 5; -} - -/* At consensus, attaches the given livehash to the given account. -The hash can be deleted by the key controlling the account, or by any of the keys associated to the livehash. -Hence livehashes provide a revocation service for their implied credentials; for example, -when an authority grants a credential to the account, the account owner will cosign with the authority (or authorities) -to attach a hash of the credential to the account---hence proving the grant. If the credential is revoked, then any of -the authorities may delete it (or the account owner). In this way, the livehash mechanism acts as a revocation service. -An account cannot have two identical livehashes associated. To modify the list of keys in a livehash, the -livehash should first be deleted, then recreated with a new list of keys. */ -message CryptoAddLiveHashTransactionBody { - // A hash of some credential or certificate, along with the keys of the entities that asserted it validity - LiveHash liveHash = 3; -} diff --git a/services/CryptoCreate.proto b/services/CryptoCreate.proto deleted file mode 100644 index 33857dc8..00000000 --- a/services/CryptoCreate.proto +++ /dev/null @@ -1,50 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "Duration.proto"; - -/* -Create a new account. After the account is created, the AccountID for it is in the receipt. It can also be retrieved with a GetByKey query. Threshold values can be defined, and records are generated and stored for 25 hours for any transfer that exceeds the thresholds. This account is charged for each record generated, so the thresholds are useful for limiting record generation to happen only for large transactions. - -The Key field is the key used to sign transactions for this account. If the account has receiverSigRequired set to true, then all cryptocurrency transfers must be signed by this account's key, both for transfers in and out. If it is false, then only transfers out have to be signed by it. When the account is created, the payer account is charged enough hbars so that the new account will not expire for the next autoRenewPeriod seconds. When it reaches the expiration time, the new account will then be automatically charged to renew for another autoRenewPeriod seconds. If it does not have enough hbars to renew for that long, then the remaining hbars are used to extend its expiration as long as possible. If it is has a zero balance when it expires, then it is deleted. This transaction must be signed by the payer account. If receiverSigRequired is false, then the transaction does not have to be signed by the keys in the keys field. If it is true, then it must be signed by them, in addition to the keys of the payer account. -An entity (account, file, or smart contract instance) must be created in a particular realm. If the realmID is left null, then a new realm will be created with the given admin key. If a new realm has a null adminKey, then anyone can create/modify/delete entities in that realm. But if an admin key is given, then any transaction to create/modify/delete an entity in that realm must be signed by that key, though anyone can still call functions on smart contract instances that exist in that realm. A realm ceases to exist when everything within it has expired and no longer exists. -The current API ignores shardID, realmID, and newRealmAdminKey, and creates everything in shard 0 and realm 0, with a null key. Future versions of the API will support multiple realms and multiple shards. - */ -message CryptoCreateTransactionBody { - Key key = 1; // The key that must sign each transfer out of the account. If receiverSigRequired is true, then it must also sign any transfer into the account. - uint64 initialBalance = 2; // The initial number of tinybars to put into the account - AccountID proxyAccountID = 3; // ID of the account to which this account is proxy staked. If proxyAccountID is null, or is an invalid account, or is an account that isn't a node, then this account is automatically proxy staked to a node chosen by the network, but without earning payments. If the proxyAccountID account refuses to accept proxy staking , or if it is not currently running a node, then it will behave as if proxyAccountID was null. - uint64 sendRecordThreshold = 6 [deprecated=true]; // [Deprecated]. The threshold amount (in tinybars) for which an account record is created for any send/withdraw transaction - uint64 receiveRecordThreshold = 7 [deprecated=true]; // [Deprecated]. The threshold amount (in tinybars) for which an account record is created for any receive/deposit transaction - bool receiverSigRequired = 8; // If true, this account's key must sign any transaction depositing into this account (in addition to all withdrawals) - Duration autoRenewPeriod = 9; // The account is charged to extend its expiration date every this many seconds. If it doesn't have enough balance, it extends as long as possible. If it is empty when it expires, then it is deleted. - ShardID shardID = 10; // The shard in which this account is created - RealmID realmID = 11; // The realm in which this account is created (leave this null to create a new realm) - Key newRealmAdminKey = 12; // If realmID is null, then this the admin key for the new realm that will be created - string memo = 13; // The memo associated with the account (UTF-8 encoding max 100 bytes) -} diff --git a/services/CryptoGetAccountBalance.proto b/services/CryptoGetAccountBalance.proto deleted file mode 100644 index 8ea9e930..00000000 --- a/services/CryptoGetAccountBalance.proto +++ /dev/null @@ -1,49 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; -import "Timestamp.proto"; - -/* Get the balance of a cryptocurrency account. This returns only the balance, so it is a smaller -reply than CryptoGetInfo, which returns the balance plus additional information. */ -message CryptoGetAccountBalanceQuery { - QueryHeader header = 1; // Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). - oneof balanceSource { - AccountID accountID = 2; // The account ID for which information is requested - ContractID contractID = 3; // The account ID for which information is requested - } -} - -/* Response when the client sends the node CryptoGetAccountBalanceQuery */ -message CryptoGetAccountBalanceResponse { - ResponseHeader header = 1; // Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither. - AccountID accountID = 2; // The account ID that is being described (this is useful with state proofs, for proving to a third party) - uint64 balance = 3; // The current balance, in tinybars. - repeated TokenBalance tokenBalances = 4; // The token balances possessed by the target account. -} diff --git a/services/CryptoGetInfo.proto b/services/CryptoGetInfo.proto deleted file mode 100644 index 4c7695da..00000000 --- a/services/CryptoGetInfo.proto +++ /dev/null @@ -1,66 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "Timestamp.proto"; -import "Duration.proto"; -import "BasicTypes.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; -import "CryptoAddLiveHash.proto"; - -/* Get all the information about an account, including the balance. This does not get the list of account records. */ -message CryptoGetInfoQuery { - QueryHeader header = 1; // Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). - AccountID accountID = 2; // The account ID for which information is requested -} - -/* Response when the client sends the node CryptoGetInfoQuery */ -message CryptoGetInfoResponse { - ResponseHeader header = 1; //Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - - message AccountInfo { - AccountID accountID = 1; // The account ID for which this information applies - string contractAccountID = 2; // The Contract Account ID comprising of both the contract instance and the cryptocurrency account owned by the contract instance, in the format used by Solidity - bool deleted = 3; // If true, then this account has been deleted, it will disappear when it expires, and all transactions for it will fail except the transaction to extend its expiration date - AccountID proxyAccountID = 4; // The Account ID of the account to which this is proxy staked. If proxyAccountID is null, or is an invalid account, or is an account that isn't a node, then this account is automatically proxy staked to a node chosen by the network, but without earning payments. If the proxyAccountID account refuses to accept proxy staking , or if it is not currently running a node, then it will behave as if proxyAccountID was null. - int64 proxyReceived = 6; // The total number of tinybars proxy staked to this account - Key key = 7; // The key for the account, which must sign in order to transfer out, or to modify the account in any way other than extending its expiration date. - uint64 balance = 8; // The current balance of account in tinybars - // [Deprecated]. The threshold amount, in tinybars, at which a record is created of any transaction that decreases the balance of this account by more than the threshold - uint64 generateSendRecordThreshold = 9 [deprecated=true]; - // [Deprecated]. The threshold amount, in tinybars, at which a record is created of any transaction that increases the balance of this account by more than the threshold - uint64 generateReceiveRecordThreshold = 10 [deprecated=true]; - bool receiverSigRequired = 11; // If true, no transaction can transfer to this account unless signed by this account's key - Timestamp expirationTime = 12; // The TimeStamp time at which this account is set to expire - Duration autoRenewPeriod = 13; // The duration for expiration time will extend every this many seconds. If there are insufficient funds, then it extends as long as possible. If it is empty when it expires, then it is deleted. - repeated LiveHash liveHashes = 14; // All of the livehashes attached to the account (each of which is a hash along with the keys that authorized it and can delete it) - repeated TokenRelationship tokenRelationships = 15; // All tokens related to this account - string memo = 16; // The memo associated with the account - int64 ownedNfts = 17; // The number of NFTs owned by this account - } - AccountInfo accountInfo = 2; // Info about the account (a state proof can be generated for this) -} diff --git a/services/CryptoGetStakers.proto b/services/CryptoGetStakers.proto deleted file mode 100644 index 4b5b2027..00000000 --- a/services/CryptoGetStakers.proto +++ /dev/null @@ -1,53 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; - -/* Get all the accounts that are proxy staking to this account. For each of them, give the amount currently staked. This is not yet implemented, but will be in a future version of the API. */ -message CryptoGetStakersQuery { - QueryHeader header = 1; // Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). - AccountID accountID = 2; // The Account ID for which the records should be retrieved -} - -/* information about a single account that is proxy staking */ -message ProxyStaker { - AccountID accountID = 1; // The Account ID that is proxy staking - int64 amount = 2; // The number of hbars that are currently proxy staked -} - -/* all of the accounts proxy staking to a given account, and the amounts proxy staked */ -message AllProxyStakers { - AccountID accountID = 1; // The Account ID that is being proxy staked to - repeated ProxyStaker proxyStaker = 2; // Each of the proxy staking accounts, and the amount they are proxy staking -} -/* Response when the client sends the node CryptoGetStakersQuery */ -message CryptoGetStakersResponse { - ResponseHeader header = 1; //Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - AllProxyStakers stakers = 3; // List of accounts proxy staking to this account, and the amount each is currently proxy staking -} diff --git a/services/CryptoTransfer.proto b/services/CryptoTransfer.proto deleted file mode 100644 index d8222d9b..00000000 --- a/services/CryptoTransfer.proto +++ /dev/null @@ -1,36 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; - -/* Transfer cryptocurrency from some accounts to other accounts. The accounts list can contain up to 10 accounts. The amounts list must be the same length as the accounts list. Each negative amount is withdrawn from the corresponding account (a sender), and each positive one is added to the corresponding account (a receiver). The amounts list must sum to zero. Each amount is a number of tinyBars (there are 100,000,000 tinyBars in one Hbar). -If any sender account fails to have sufficient hbars, then the entire transaction fails, and none of those transfers occur, though the transaction fee is still charged. This transaction must be signed by the keys for all the sending accounts, and for any receiving accounts that have receiverSigRequired == true. The signatures are in the same order as the accounts, skipping those accounts that don't need a signature. -*/ -message CryptoTransferTransactionBody { - TransferList transfers = 1; - repeated TokenTransferList tokenTransfers = 2; -} diff --git a/services/CryptoUpdate.proto b/services/CryptoUpdate.proto deleted file mode 100644 index ad7e3e3a..00000000 --- a/services/CryptoUpdate.proto +++ /dev/null @@ -1,56 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "Duration.proto"; -import "Timestamp.proto"; -import "google/protobuf/wrappers.proto"; - -/* -Change properties for the given account. Any null field is ignored (left unchanged). This transaction must be signed by the existing key for this account. If the transaction is changing the key field, then the transaction must be signed by both the old key (from before the change) and the new key. The old key must sign for security. The new key must sign as a safeguard to avoid accidentally changing to an invalid key, and then having no way to recover. -*/ -message CryptoUpdateTransactionBody { - AccountID accountIDToUpdate = 2; // The account ID which is being updated in this transaction - Key key = 3; // The new key - AccountID proxyAccountID = 4; // ID of the account to which this account is proxy staked. If proxyAccountID is null, or is an invalid account, or is an account that isn't a node, then this account is automatically proxy staked to a node chosen by the network, but without earning payments. If the proxyAccountID account refuses to accept proxy staking , or if it is not currently running a node, then it will behave as if proxyAccountID was null. - int32 proxyFraction = 5 [deprecated = true]; // [Deprecated]. Payments earned from proxy staking are shared between the node and this account, with proxyFraction / 10000 going to this account - oneof sendRecordThresholdField { - uint64 sendRecordThreshold = 6 [deprecated = true]; // [Deprecated]. The new threshold amount (in tinybars) for which an account record is created for any send/withdraw transaction - google.protobuf.UInt64Value sendRecordThresholdWrapper = 11 [deprecated = true]; // [Deprecated]. The new threshold amount (in tinybars) for which an account record is created for any send/withdraw transaction - } - oneof receiveRecordThresholdField { - uint64 receiveRecordThreshold = 7 [deprecated = true]; // [Deprecated]. The new threshold amount (in tinybars) for which an account record is created for any receive/deposit transaction. - google.protobuf.UInt64Value receiveRecordThresholdWrapper = 12 [deprecated = true]; // [Deprecated]. The new threshold amount (in tinybars) for which an account record is created for any receive/deposit transaction. - } - Duration autoRenewPeriod = 8; // The duration in which it will automatically extend the expiration period. If it doesn't have enough balance, it extends as long as possible. If it is empty when it expires, then it is deleted. - Timestamp expirationTime = 9; // The new expiration time to extend to (ignored if equal to or before the current one) - oneof receiverSigRequiredField { - bool receiverSigRequired = 10 [deprecated = true]; // [Deprecated] Do NOT use this field to set a false value because the server cannot distinguish from the default value. Use receiverSigRequiredWrapper field for this purpose. - google.protobuf.BoolValue receiverSigRequiredWrapper = 13; // If true, this account's key must sign any transaction depositing into this account (in addition to all withdrawals) - } - google.protobuf.StringValue memo = 14; // If set, the new memo to be associated with the account (UTF-8 encoding max 100 bytes) -} diff --git a/services/FileCreate.proto b/services/FileCreate.proto deleted file mode 100644 index 6fe7dcb3..00000000 --- a/services/FileCreate.proto +++ /dev/null @@ -1,53 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "Timestamp.proto"; - -/* Create a new file, containing the given contents. -After the file is created, the FileID for it can be found in the receipt, or record, or retrieved with a GetByKey query. - - The file contains the specified contents (possibly empty). The file will automatically disappear at the expirationTime, unless its expiration is extended by another transaction before that time. If the file is deleted, then its contents will become empty and it will be marked as deleted until it expires, and then it will cease to exist. - - The keys field is a list of keys. All keys within the top-level key list must sign (M-M) to create or modify a file. However, to delete the file, only one key (1-M) is required to sign from the top-level key list. Each of those "keys" may itself be threshold key containing other keys (including other threshold keys). In other words, the behavior is an AND for create/modify, OR for delete. This is useful for acting as a revocation server. If it is desired to have the behavior be AND for all 3 operations (or OR for all 3), then the list should have only a single Key, which is a threshold key, with N=1 for OR, N=M for AND. - - If a file is created without ANY keys in the keys field, the file is immutable and ONLY the expirationTime of the file can be changed with a FileUpdate transaction. The file contents or its keys cannot be changed. - - An entity (account, file, or smart contract instance) must be created in a particular realm. If the realmID is left null, then a new realm will be created with the given admin key. If a new realm has a null adminKey, then anyone can create/modify/delete entities in that realm. But if an admin key is given, then any transaction to create/modify/delete an entity in that realm must be signed by that key, though anyone can still call functions on smart contract instances that exist in that realm. A realm ceases to exist when everything within it has expired and no longer exists. - - The current API ignores shardID, realmID, and newRealmAdminKey, and creates everything in shard 0 and realm 0, with a null key. Future versions of the API will support multiple realms and multiple shards. - */ -message FileCreateTransactionBody { - Timestamp expirationTime = 2; // The time at which this file should expire (unless FileUpdateTransaction is used before then to extend its life) - KeyList keys = 3; // All keys at the top level of a key list must sign to create or modify the file. Any one of the keys at the top level key list can sign to delete the file. - bytes contents = 4; // The bytes that are the contents of the file - - ShardID shardID = 5; // Shard in which this file is created - RealmID realmID = 6; // The Realm in which to the file is created (leave this null to create a new realm) - Key newRealmAdminKey = 7; // If realmID is null, then this the admin key for the new realm that will be created - string memo = 8; // The memo associated with the file (UTF-8 encoding max 100 bytes) -} diff --git a/services/FileGetContents.proto b/services/FileGetContents.proto deleted file mode 100644 index 34d0a464..00000000 --- a/services/FileGetContents.proto +++ /dev/null @@ -1,48 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; - -/* Get the contents of a file. The content field is empty (no bytes) if the file is empty. */ -message FileGetContentsQuery { - QueryHeader header = 1; // Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). - FileID fileID = 2; // The file ID of the file whose contents are requested -} - -/* Response when the client sends the node FileGetContentsQuery */ -message FileGetContentsResponse { - ResponseHeader header = 1; //Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - message FileContents { - FileID fileID = 1; // The file ID of the file whose contents are being returned - bytes contents = 2; // The bytes contained in the file - } - FileContents fileContents = 2; // the file ID and contents (a state proof can be generated for this) -} - - diff --git a/services/FileGetInfo.proto b/services/FileGetInfo.proto deleted file mode 100644 index 35478227..00000000 --- a/services/FileGetInfo.proto +++ /dev/null @@ -1,52 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "Timestamp.proto"; -import "BasicTypes.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; - -/* Get all of the information about a file, except for its contents. When a file expires, it no longer exists, and there will be no info about it, and the fileInfo field will be blank. If a transaction or smart contract deletes the file, but it has not yet expired, then the fileInfo field will be non-empty, the deleted field will be true, its size will be 0, and its contents will be empty. */ -message FileGetInfoQuery { - QueryHeader header = 1; // Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). - FileID fileID = 2; // The file ID of the file for which information is requested -} - -/* Response when the client sends the node FileGetInfoQuery */ -message FileGetInfoResponse { - ResponseHeader header = 1; //Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - - message FileInfo { - FileID fileID = 1; // The file ID of the file for which information is requested - int64 size = 2; // Number of bytes in contents - Timestamp expirationTime = 3; // The current time at which this account is set to expire - bool deleted = 4; // True if deleted but not yet expired - KeyList keys = 5; // One of these keys must sign in order to modify or delete the file - string memo = 6; // The memo associated with the file - } - FileInfo fileInfo = 2; // The information about the file -} diff --git a/services/FileUpdate.proto b/services/FileUpdate.proto deleted file mode 100644 index c4a02d3a..00000000 --- a/services/FileUpdate.proto +++ /dev/null @@ -1,41 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "Timestamp.proto"; -import "google/protobuf/wrappers.proto"; - -/* -Modify the metadata and/or contents of a file. If a field is not set in the transaction body, the corresponding file attribute will be unchanged. This transaction must be signed by all the keys in the top level of a key list (M-of-M) of the file being updated. If the keys themselves are being updated, then the transaction must also be signed by all the new keys. If the keys contain additional KeyList or ThresholdKey then M-of-M secondary KeyList or ThresholdKey signing requirements must be meet - */ -message FileUpdateTransactionBody { - FileID fileID = 1; // The ID of the file to update - Timestamp expirationTime = 2; // The new expiry time (ignored if not later than the current expiry) - KeyList keys = 3; // The new list of keys that can modify or delete the file - bytes contents = 4; // The new contents that should overwrite the file's current contents - google.protobuf.StringValue memo = 5; // If set, the new memo to be associated with the file (UTF-8 encoding max 100 bytes) -} diff --git a/services/Freeze.proto b/services/Freeze.proto deleted file mode 100644 index 27d9ed07..00000000 --- a/services/Freeze.proto +++ /dev/null @@ -1,40 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "Duration.proto"; -import "Timestamp.proto"; -import "BasicTypes.proto"; - -/* Set the freezing period in which the platform will stop creating events and accepting transactions. This is used before safely shut down the platform for maintenance. */ -message FreezeTransactionBody { - int32 startHour = 1; // The start hour (in UTC time), a value between 0 and 23 - int32 startMin = 2; // The start minute (in UTC time), a value between 0 and 59 - int32 endHour = 3; // The end hour (in UTC time), a value between 0 and 23 - int32 endMin = 4; // The end minute (in UTC time), a value between 0 and 59 - FileID updateFile = 5; // The ID of the file needs to be updated during a freeze transaction - bytes fileHash = 6; // The hash value of the file, used to verify file content before performing freeze and update -} diff --git a/services/GetByKey.proto b/services/GetByKey.proto deleted file mode 100644 index 970034b2..00000000 --- a/services/GetByKey.proto +++ /dev/null @@ -1,54 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; -import "CryptoAddLiveHash.proto"; - -/* Get all accounts, claims, files, and smart contract instances whose associated keys include the given Key. The given Key must not be a contractID or a ThresholdKey. This is not yet implemented in the API, but will be in the future. */ -message GetByKeyQuery { - QueryHeader header = 1; // Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). - Key key = 2; // The key to search for. It must not contain a contractID nor a ThresholdSignature. -} - -/* the ID for a single entity (account, livehash, file, or smart contract instance) */ -message EntityID { - oneof entity { - AccountID accountID = 1; // The Account ID for the cryptocurrency account - LiveHash liveHash = 2; // A uniquely identifying livehash of an acount - FileID fileID = 3; // The file ID of the file - ContractID contractID = 4; // The smart contract ID that identifies instance - } -} -/* Response when the client sends the node GetByKeyQuery */ -message GetByKeyResponse { - ResponseHeader header = 1; //Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - repeated EntityID entities = 2; // The list of entities that include this public key in their associated Key list -} - - diff --git a/services/GetBySolidityID.proto b/services/GetBySolidityID.proto deleted file mode 100644 index 14063046..00000000 --- a/services/GetBySolidityID.proto +++ /dev/null @@ -1,46 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; - -/* Get the IDs in the format used by transactions, given the ID in the format used by Solidity. If the Solidity ID is for a smart contract instance, then both the ContractID and associated AccountID will be returned. */ -message GetBySolidityIDQuery { - QueryHeader header = 1; // Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). - string solidityID = 2; // The ID in the format used by Solidity -} - -/* Response when the client sends the node GetBySolidityIDQuery */ -message GetBySolidityIDResponse { - ResponseHeader header = 1; // Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - AccountID accountID = 2; // The Account ID for the cryptocurrency account - FileID fileID = 3; // The file Id for the file - ContractID contractID = 4; // A smart contract ID for the instance (if this is included, then the associated accountID will also be included) -} - - diff --git a/services/NetworkGetVersionInfo.proto b/services/NetworkGetVersionInfo.proto deleted file mode 100644 index e7dcf41e..00000000 --- a/services/NetworkGetVersionInfo.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; - -/* Get the deployed versions of Hedera Services and the HAPI proto in semantic version format */ -message NetworkGetVersionInfoQuery { - QueryHeader header = 1; // Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). -} - -/* Response when the client sends the node NetworkGetVersionInfoQuery */ -message NetworkGetVersionInfoResponse { - ResponseHeader header = 1; // Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - SemanticVersion hapiProtoVersion = 2; // The Hedera API (HAPI) protobuf version recognized by the responding node. - SemanticVersion hederaServicesVersion = 3; // The version of the Hedera Services software deployed on the responding node. -} diff --git a/services/NetworkService.proto b/services/NetworkService.proto deleted file mode 100644 index 49fce7df..00000000 --- a/services/NetworkService.proto +++ /dev/null @@ -1,36 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.service.proto.java"; - -import "Query.proto"; -import "Response.proto"; -import "TransactionResponse.proto"; -import "Transaction.proto"; - -/* The requests and responses for different network services. */ -service NetworkService { - rpc getVersionInfo (Query) returns (Response); // Retrieves the active versions of Hedera Services and HAPI proto - rpc uncheckedSubmit (Transaction) returns (TransactionResponse); // Submits a "wrapped" transaction to the network, skipping its standard prechecks. (Note that the "wrapper" UncheckedSubmit transaction is still subject to normal prechecks, including an authorization requirement that its payer be either the treasury or system admin account.) -} diff --git a/services/Query.proto b/services/Query.proto deleted file mode 100644 index e966f0dd..00000000 --- a/services/Query.proto +++ /dev/null @@ -1,93 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "GetByKey.proto"; -import "GetBySolidityID.proto"; - -import "ContractCallLocal.proto"; -import "ContractGetInfo.proto"; -import "ContractGetBytecode.proto"; -import "ContractGetRecords.proto"; - -import "CryptoGetAccountBalance.proto"; -import "CryptoGetAccountRecords.proto"; -import "CryptoGetInfo.proto"; -import "CryptoGetLiveHash.proto"; -import "CryptoGetStakers.proto"; - -import "FileGetContents.proto"; -import "FileGetInfo.proto"; - -import "TransactionGetReceipt.proto"; -import "TransactionGetRecord.proto"; -import "TransactionGetFastRecord.proto"; - -import "ConsensusGetTopicInfo.proto"; - -import "NetworkGetVersionInfo.proto"; -import "TokenGetInfo.proto"; -import "ScheduleGetInfo.proto"; - -import "TokenGetAccountNftInfo.proto"; -import "TokenGetNftInfo.proto"; -import "TokenGetNftInfos.proto"; - -/* A single query, which is sent from the client to a node. This includes all possible queries. Each Query should not have more than 50 levels. */ -message Query { - oneof query { - GetByKeyQuery getByKey = 1; // Get all entities associated with a given key - GetBySolidityIDQuery getBySolidityID = 2; // Get the IDs in the format used in transactions, given the format used in Solidity - ContractCallLocalQuery contractCallLocal = 3; // Call a function of a smart contract instance - ContractGetInfoQuery contractGetInfo = 4; // Get information about a smart contract instance - ContractGetBytecodeQuery contractGetBytecode = 5; // Get bytecode used by a smart contract instance - ContractGetRecordsQuery ContractGetRecords = 6; // Get Records of the contract instance - - CryptoGetAccountBalanceQuery cryptogetAccountBalance = 7; // Get the current balance in a cryptocurrency account - CryptoGetAccountRecordsQuery cryptoGetAccountRecords = 8; // Get all the records that currently exist for transactions involving an account - CryptoGetInfoQuery cryptoGetInfo = 9; // Get all information about an account - CryptoGetLiveHashQuery cryptoGetLiveHash = 10; // Get a single livehash from a single account, if present - CryptoGetStakersQuery cryptoGetProxyStakers = 11; // Get all the accounts that proxy stake to a given account, and how much they proxy stake (not yet implemented in the current API) - - FileGetContentsQuery fileGetContents = 12; // Get the contents of a file (the bytes stored in it) - FileGetInfoQuery fileGetInfo = 13; // Get information about a file, such as its expiration date - - TransactionGetReceiptQuery transactionGetReceipt = 14; // Get a receipt for a transaction (lasts 180 seconds) - TransactionGetRecordQuery transactionGetRecord = 15; // Get a record for a transaction - TransactionGetFastRecordQuery transactionGetFastRecord = 16; // Get a record for a transaction (lasts 180 seconds) - ConsensusGetTopicInfoQuery consensusGetTopicInfo = 50; // Get the parameters of and state of a consensus topic. - - NetworkGetVersionInfoQuery networkGetVersionInfo = 51; // Get the versions of the HAPI protobuf and Hedera Services software deployed on the responding node. - - TokenGetInfoQuery tokenGetInfo = 52; // Get all information about a token - - ScheduleGetInfoQuery scheduleGetInfo = 53; // Get all information about a scheduled entity - - TokenGetAccountNftInfoQuery tokenGetAccountNftInfo = 54; // Get a list of NFTs associated with the account - TokenGetNftInfoQuery tokenGetNftInfo = 55; // Get all information about a NFT - TokenGetNftInfosQuery tokenGetNftInfos = 56; // Get a list of NFTs for the token - } -} diff --git a/services/QueryHeader.proto b/services/QueryHeader.proto deleted file mode 100644 index 4a074101..00000000 --- a/services/QueryHeader.proto +++ /dev/null @@ -1,50 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "Transaction.proto"; - -/* -The client uses the ResponseType to indicate that it desires the node send just the answer, or both the answer and a state proof. It can also ask for just the cost and not the answer itself (allowing it to tailor the payment transaction accordingly). If the payment in the query fails the precheck, then the response may have some fields blank. The state proof is only available for some types of information. It is available for a Record, but not a receipt. It is available for the information in each kind of *GetInfo request. -*/ -enum ResponseType { - // Response returns answer - ANSWER_ONLY = 0; - // (NOT YET SUPPORTED) Response returns both answer and state proof - ANSWER_STATE_PROOF = 1; - // Response returns the cost of answer - COST_ANSWER = 2; - // (NOT YET SUPPORTED) Response returns the total cost of answer and state proof - COST_ANSWER_STATE_PROOF = 3; -} - -/* -Each query from the client to the node will contain the QueryHeader, which gives the requested response type, and includes a payment transaction that will compensate the node for responding to the query. The payment can be blank if the query is free. -*/ -message QueryHeader { - Transaction payment = 1; // A signed CryptoTransferTransaction to pay the node a fee for handling this query - ResponseType responseType = 2; // The requested response, asking for cost, state proof, both, or neither -} diff --git a/services/Response.proto b/services/Response.proto deleted file mode 100644 index 8f7c8ef4..00000000 --- a/services/Response.proto +++ /dev/null @@ -1,97 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "GetByKey.proto"; -import "GetBySolidityID.proto"; - -import "ContractCallLocal.proto"; -import "ContractGetBytecode.proto"; -import "ContractGetInfo.proto"; -import "ContractGetRecords.proto"; - -import "CryptoGetAccountBalance.proto"; -import "CryptoGetAccountRecords.proto"; -import "CryptoGetInfo.proto"; -import "CryptoGetLiveHash.proto"; -import "CryptoGetStakers.proto"; - -import "FileGetContents.proto"; -import "FileGetInfo.proto"; - -import "TransactionGetReceipt.proto"; -import "TransactionGetRecord.proto"; -import "TransactionGetFastRecord.proto"; - -import "ConsensusGetTopicInfo.proto"; - -import "NetworkGetVersionInfo.proto"; - -import "TokenGetAccountNftInfo.proto"; -import "TokenGetInfo.proto"; -import "TokenGetNftInfo.proto"; -import "TokenGetNftInfos.proto"; - -import "ScheduleGetInfo.proto"; - - -/* A single response, which is returned from the node to the client, after the client sent the node a query. This includes all responses. */ -message Response { - oneof response { - GetByKeyResponse getByKey = 1; // Get all entities associated with a given key - GetBySolidityIDResponse getBySolidityID = 2; // Get the IDs in the format used in transactions, given the format used in Solidity - - ContractCallLocalResponse contractCallLocal = 3; // Response to call a function of a smart contract instance - ContractGetBytecodeResponse contractGetBytecodeResponse = 5; // Get the bytecode for a smart contract instance - ContractGetInfoResponse contractGetInfo = 4; // Get information about a smart contract instance - ContractGetRecordsResponse contractGetRecordsResponse = 6; //Get all existing records for a smart contract instance - - CryptoGetAccountBalanceResponse cryptogetAccountBalance = 7; // Get the current balance in a cryptocurrency account - CryptoGetAccountRecordsResponse cryptoGetAccountRecords = 8; // Get all the records that currently exist for transactions involving an account - CryptoGetInfoResponse cryptoGetInfo = 9; // Get all information about an account - CryptoGetLiveHashResponse cryptoGetLiveHash = 10; // Contains a livehash associated to an account - CryptoGetStakersResponse cryptoGetProxyStakers = 11; // Get all the accounts that proxy stake to a given account, and how much they proxy stake - - FileGetContentsResponse fileGetContents = 12; // Get the contents of a file (the bytes stored in it) - FileGetInfoResponse fileGetInfo = 13; // Get information about a file, such as its expiration date - - TransactionGetReceiptResponse transactionGetReceipt = 14; // Get a receipt for a transaction - TransactionGetRecordResponse transactionGetRecord = 15; // Get a record for a transaction - TransactionGetFastRecordResponse transactionGetFastRecord = 16; // Get a record for a transaction (lasts 180 seconds) - - ConsensusGetTopicInfoResponse consensusGetTopicInfo = 150; // Parameters of and state of a consensus topic.. - - NetworkGetVersionInfoResponse networkGetVersionInfo = 151; // Semantic versions of Hedera Services and HAPI proto - - TokenGetInfoResponse tokenGetInfo = 152; // Get all information about a token - - ScheduleGetInfoResponse scheduleGetInfo = 153; // Get all information about a schedule entity - - TokenGetAccountNftInfoResponse tokenGetAccountNftInfo = 154; // A list of the NFTs associated with the account - TokenGetNftInfoResponse tokenGetNftInfo = 155; // All information about an NFT - TokenGetNftInfosResponse tokenGetNftInfos = 156; // A list of the NFTs for the token - } -} diff --git a/services/ResponseCode.proto b/services/ResponseCode.proto deleted file mode 100644 index 5ccf28b8..00000000 --- a/services/ResponseCode.proto +++ /dev/null @@ -1,240 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -enum ResponseCodeEnum { - OK = 0; // The transaction passed the precheck validations. - INVALID_TRANSACTION = 1; // For any error not handled by specific error codes listed below. - PAYER_ACCOUNT_NOT_FOUND = 2; //Payer account does not exist. - INVALID_NODE_ACCOUNT = 3; //Node Account provided does not match the node account of the node the transaction was submitted to. - TRANSACTION_EXPIRED = 4; // Pre-Check error when TransactionValidStart + transactionValidDuration is less than current consensus time. - INVALID_TRANSACTION_START = 5; // Transaction start time is greater than current consensus time - INVALID_TRANSACTION_DURATION = 6; //valid transaction duration is a positive non zero number that does not exceed 120 seconds - INVALID_SIGNATURE = 7; // The transaction signature is not valid - MEMO_TOO_LONG = 8; //Transaction memo size exceeded 100 bytes - INSUFFICIENT_TX_FEE = 9; // The fee provided in the transaction is insufficient for this type of transaction - INSUFFICIENT_PAYER_BALANCE = 10; // The payer account has insufficient cryptocurrency to pay the transaction fee - DUPLICATE_TRANSACTION = 11; // This transaction ID is a duplicate of one that was submitted to this node or reached consensus in the last 180 seconds (receipt period) - BUSY = 12; //If API is throttled out - NOT_SUPPORTED = 13; //The API is not currently supported - - INVALID_FILE_ID = 14; //The file id is invalid or does not exist - INVALID_ACCOUNT_ID = 15; //The account id is invalid or does not exist - INVALID_CONTRACT_ID = 16; //The contract id is invalid or does not exist - INVALID_TRANSACTION_ID = 17; //Transaction id is not valid - RECEIPT_NOT_FOUND = 18; //Receipt for given transaction id does not exist - RECORD_NOT_FOUND = 19; //Record for given transaction id does not exist - INVALID_SOLIDITY_ID = 20; //The solidity id is invalid or entity with this solidity id does not exist - - - UNKNOWN = 21; // The responding node has submitted the transaction to the network. Its final status is still unknown. - SUCCESS = 22; // The transaction succeeded - FAIL_INVALID = 23; // There was a system error and the transaction failed because of invalid request parameters. - FAIL_FEE = 24; // There was a system error while performing fee calculation, reserved for future. - FAIL_BALANCE = 25; // There was a system error while performing balance checks, reserved for future. - - - KEY_REQUIRED = 26; //Key not provided in the transaction body - BAD_ENCODING = 27; //Unsupported algorithm/encoding used for keys in the transaction - INSUFFICIENT_ACCOUNT_BALANCE = 28; //When the account balance is not sufficient for the transfer - INVALID_SOLIDITY_ADDRESS = 29; //During an update transaction when the system is not able to find the Users Solidity address - - - INSUFFICIENT_GAS = 30; //Not enough gas was supplied to execute transaction - CONTRACT_SIZE_LIMIT_EXCEEDED = 31; //contract byte code size is over the limit - LOCAL_CALL_MODIFICATION_EXCEPTION = 32; //local execution (query) is requested for a function which changes state - CONTRACT_REVERT_EXECUTED = 33; //Contract REVERT OPCODE executed - CONTRACT_EXECUTION_EXCEPTION = 34; //For any contract execution related error not handled by specific error codes listed above. - INVALID_RECEIVING_NODE_ACCOUNT = 35; //In Query validation, account with +ve(amount) value should be Receiving node account, the receiver account should be only one account in the list - MISSING_QUERY_HEADER = 36; // Header is missing in Query request - - - ACCOUNT_UPDATE_FAILED = 37; // The update of the account failed - INVALID_KEY_ENCODING = 38; // Provided key encoding was not supported by the system - NULL_SOLIDITY_ADDRESS = 39; // null solidity address - - CONTRACT_UPDATE_FAILED = 40; // update of the contract failed - INVALID_QUERY_HEADER = 41; // the query header is invalid - - INVALID_FEE_SUBMITTED = 42; // Invalid fee submitted - INVALID_PAYER_SIGNATURE = 43; // Payer signature is invalid - - - KEY_NOT_PROVIDED = 44; // The keys were not provided in the request. - INVALID_EXPIRATION_TIME = 45; // Expiration time provided in the transaction was invalid. - NO_WACL_KEY = 46; //WriteAccess Control Keys are not provided for the file - FILE_CONTENT_EMPTY = 47; //The contents of file are provided as empty. - INVALID_ACCOUNT_AMOUNTS = 48; // The crypto transfer credit and debit do not sum equal to 0 - EMPTY_TRANSACTION_BODY = 49; // Transaction body provided is empty - INVALID_TRANSACTION_BODY = 50; // Invalid transaction body provided - - - INVALID_SIGNATURE_TYPE_MISMATCHING_KEY = 51; // the type of key (base ed25519 key, KeyList, or ThresholdKey) does not match the type of signature (base ed25519 signature, SignatureList, or ThresholdKeySignature) - INVALID_SIGNATURE_COUNT_MISMATCHING_KEY = 52; // the number of key (KeyList, or ThresholdKey) does not match that of signature (SignatureList, or ThresholdKeySignature). e.g. if a keyList has 3 base keys, then the corresponding signatureList should also have 3 base signatures. - - EMPTY_LIVE_HASH_BODY = 53; // the livehash body is empty - EMPTY_LIVE_HASH = 54; // the livehash data is missing - EMPTY_LIVE_HASH_KEYS = 55; // the keys for a livehash are missing - INVALID_LIVE_HASH_SIZE = 56; // the livehash data is not the output of a SHA-384 digest - - EMPTY_QUERY_BODY = 57; // the query body is empty - EMPTY_LIVE_HASH_QUERY = 58; // the crypto livehash query is empty - LIVE_HASH_NOT_FOUND = 59; // the livehash is not present - ACCOUNT_ID_DOES_NOT_EXIST = 60; // the account id passed has not yet been created. - LIVE_HASH_ALREADY_EXISTS = 61; // the livehash already exists for a given account - - - INVALID_FILE_WACL = 62; // File WACL keys are invalid - SERIALIZATION_FAILED = 63; // Serialization failure - TRANSACTION_OVERSIZE = 64; // The size of the Transaction is greater than transactionMaxBytes - TRANSACTION_TOO_MANY_LAYERS = 65; // The Transaction has more than 50 levels - CONTRACT_DELETED = 66; //Contract is marked as deleted - - PLATFORM_NOT_ACTIVE = 67; // the platform node is either disconnected or lagging behind. - KEY_PREFIX_MISMATCH = 68; // one public key matches more than one prefixes on the signature map - PLATFORM_TRANSACTION_NOT_CREATED = 69; // transaction not created by platform due to large backlog - INVALID_RENEWAL_PERIOD = 70; // auto renewal period is not a positive number of seconds - INVALID_PAYER_ACCOUNT_ID = 71; // the response code when a smart contract id is passed for a crypto API request - ACCOUNT_DELETED = 72; // the account has been marked as deleted - FILE_DELETED = 73; // the file has been marked as deleted - ACCOUNT_REPEATED_IN_ACCOUNT_AMOUNTS = 74; // same accounts repeated in the transfer account list - SETTING_NEGATIVE_ACCOUNT_BALANCE = 75; // attempting to set negative balance value for crypto account - OBTAINER_REQUIRED =76; // when deleting smart contract that has crypto balance either transfer account or transfer smart contract is required - OBTAINER_SAME_CONTRACT_ID =77; //when deleting smart contract that has crypto balance you can not use the same contract id as transferContractId as the one being deleted - OBTAINER_DOES_NOT_EXIST = 78; //transferAccountId or transferContractId specified for contract delete does not exist - MODIFYING_IMMUTABLE_CONTRACT = 79; //attempting to modify (update or delete a immutable smart contract, i.e. one created without a admin key) - FILE_SYSTEM_EXCEPTION = 80; //Unexpected exception thrown by file system functions - AUTORENEW_DURATION_NOT_IN_RANGE = 81; // the duration is not a subset of [MINIMUM_AUTORENEW_DURATION,MAXIMUM_AUTORENEW_DURATION] - ERROR_DECODING_BYTESTRING = 82; // Decoding the smart contract binary to a byte array failed. Check that the input is a valid hex string. - CONTRACT_FILE_EMPTY = 83; // File to create a smart contract was of length zero - CONTRACT_BYTECODE_EMPTY = 84; // Bytecode for smart contract is of length zero - INVALID_INITIAL_BALANCE=85; // Attempt to set negative initial balance - INVALID_RECEIVE_RECORD_THRESHOLD=86 [deprecated=true]; // [Deprecated]. attempt to set negative receive record threshold - INVALID_SEND_RECORD_THRESHOLD=87 [deprecated=true]; // [Deprecated]. attempt to set negative send record threshold - ACCOUNT_IS_NOT_GENESIS_ACCOUNT = 88; // Special Account Operations should be performed by only Genesis account, return this code if it is not Genesis Account - PAYER_ACCOUNT_UNAUTHORIZED = 89; // The fee payer account doesn't have permission to submit such Transaction - INVALID_FREEZE_TRANSACTION_BODY = 90; // FreezeTransactionBody is invalid - FREEZE_TRANSACTION_BODY_NOT_FOUND = 91; // FreezeTransactionBody does not exist - TRANSFER_LIST_SIZE_LIMIT_EXCEEDED = 92; //Exceeded the number of accounts (both from and to) allowed for crypto transfer list - RESULT_SIZE_LIMIT_EXCEEDED = 93; // Smart contract result size greater than specified maxResultSize - NOT_SPECIAL_ACCOUNT = 94; //The payer account is not a special account(account 0.0.55) - CONTRACT_NEGATIVE_GAS = 95; // Negative gas was offered in smart contract call - CONTRACT_NEGATIVE_VALUE = 96; // Negative value / initial balance was specified in a smart contract call / create - INVALID_FEE_FILE=97; // Failed to update fee file - INVALID_EXCHANGE_RATE_FILE=98; // Failed to update exchange rate file - INSUFFICIENT_LOCAL_CALL_GAS = 99; // Payment tendered for contract local call cannot cover both the fee and the gas - ENTITY_NOT_ALLOWED_TO_DELETE = 100; // Entities with Entity ID below 1000 are not allowed to be deleted - AUTHORIZATION_FAILED = 101; // Violating one of these rules: 1) treasury account can update all entities below 0.0.1000, 2) account 0.0.50 can update all entities from 0.0.51 - 0.0.80, 3) Network Function Master Account A/c 0.0.50 - Update all Network Function accounts & perform all the Network Functions listed below, 4) Network Function Accounts: i) A/c 0.0.55 - Update Address Book files (0.0.101/102), ii) A/c 0.0.56 - Update Fee schedule (0.0.111), iii) A/c 0.0.57 - Update Exchange Rate (0.0.112). - FILE_UPLOADED_PROTO_INVALID = 102; // Fee Schedule Proto uploaded but not valid (append or update is required) - FILE_UPLOADED_PROTO_NOT_SAVED_TO_DISK = 103; // Fee Schedule Proto uploaded but not valid (append or update is required) - FEE_SCHEDULE_FILE_PART_UPLOADED = 104; // Fee Schedule Proto File Part uploaded - EXCHANGE_RATE_CHANGE_LIMIT_EXCEEDED = 105; // The change on Exchange Rate exceeds Exchange_Rate_Allowed_Percentage - MAX_CONTRACT_STORAGE_EXCEEDED = 106; // Contract permanent storage exceeded the currently allowable limit - TRANSFER_ACCOUNT_SAME_AS_DELETE_ACCOUNT = 107; // Transfer Account should not be same as Account to be deleted - TOTAL_LEDGER_BALANCE_INVALID = 108; - EXPIRATION_REDUCTION_NOT_ALLOWED = 110; // The expiration date/time on a smart contract may not be reduced - MAX_GAS_LIMIT_EXCEEDED = 111; //Gas exceeded currently allowable gas limit per transaction - MAX_FILE_SIZE_EXCEEDED = 112; // File size exceeded the currently allowable limit - INVALID_TOPIC_ID = 150; // The Topic ID specified is not in the system. - INVALID_ADMIN_KEY = 155; // A provided admin key was invalid. - INVALID_SUBMIT_KEY = 156; // A provided submit key was invalid. - UNAUTHORIZED = 157; // An attempted operation was not authorized (ie - a deleteTopic for a topic with no adminKey). - INVALID_TOPIC_MESSAGE = 158; // A ConsensusService message is empty. - INVALID_AUTORENEW_ACCOUNT = 159; // The autoRenewAccount specified is not a valid, active account. - AUTORENEW_ACCOUNT_NOT_ALLOWED = 160; // An adminKey was not specified on the topic, so there must not be an autoRenewAccount. - // The topic has expired, was not automatically renewed, and is in a 7 day grace period before the topic will be - // deleted unrecoverably. This error response code will not be returned until autoRenew functionality is supported - // by HAPI. - TOPIC_EXPIRED = 162; - INVALID_CHUNK_NUMBER = 163; // chunk number must be from 1 to total (chunks) inclusive. - INVALID_CHUNK_TRANSACTION_ID = 164; // For every chunk, the payer account that is part of initialTransactionID must match the Payer Account of this transaction. The entire initialTransactionID should match the transactionID of the first chunk, but this is not checked or enforced by Hedera except when the chunk number is 1. - ACCOUNT_FROZEN_FOR_TOKEN = 165; // Account is frozen and cannot transact with the token - TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED = 166; // An involved account already has more than tokens.maxPerAccount associations with non-deleted tokens. - INVALID_TOKEN_ID = 167; // The token is invalid or does not exist - INVALID_TOKEN_DECIMALS = 168; // Invalid token decimals - INVALID_TOKEN_INITIAL_SUPPLY = 169; // Invalid token initial supply - INVALID_TREASURY_ACCOUNT_FOR_TOKEN = 170; // Treasury Account does not exist or is deleted - INVALID_TOKEN_SYMBOL = 171; // Token Symbol is not UTF-8 capitalized alphabetical string - TOKEN_HAS_NO_FREEZE_KEY = 172; // Freeze key is not set on token - TRANSFERS_NOT_ZERO_SUM_FOR_TOKEN = 173; // Amounts in transfer list are not net zero - MISSING_TOKEN_SYMBOL = 174; // A token symbol was not provided - TOKEN_SYMBOL_TOO_LONG = 175; // The provided token symbol was too long - ACCOUNT_KYC_NOT_GRANTED_FOR_TOKEN = 176; // KYC must be granted and account does not have KYC granted - TOKEN_HAS_NO_KYC_KEY = 177; // KYC key is not set on token - INSUFFICIENT_TOKEN_BALANCE = 178; // Token balance is not sufficient for the transaction - TOKEN_WAS_DELETED = 179; // Token transactions cannot be executed on deleted token - TOKEN_HAS_NO_SUPPLY_KEY = 180; // Supply key is not set on token - TOKEN_HAS_NO_WIPE_KEY = 181; // Wipe key is not set on token - INVALID_TOKEN_MINT_AMOUNT = 182; // The requested token mint amount would cause an invalid total supply - INVALID_TOKEN_BURN_AMOUNT = 183; // The requested token burn amount would cause an invalid total supply - TOKEN_NOT_ASSOCIATED_TO_ACCOUNT = 184; // A required token-account relationship is missing - CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT = 185; // The target of a wipe operation was the token treasury account - INVALID_KYC_KEY = 186; // The provided KYC key was invalid. - INVALID_WIPE_KEY = 187; // The provided wipe key was invalid. - INVALID_FREEZE_KEY = 188; // The provided freeze key was invalid. - INVALID_SUPPLY_KEY = 189; // The provided supply key was invalid. - MISSING_TOKEN_NAME = 190; // Token Name is not provided - TOKEN_NAME_TOO_LONG = 191; // Token Name is too long - INVALID_WIPING_AMOUNT = 192; // The provided wipe amount must not be negative, zero or bigger than the token holder balance - TOKEN_IS_IMMUTABLE = 193; // Token does not have Admin key set, thus update/delete transactions cannot be performed - TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT = 194; // An associateToken operation specified a token already associated to the account - TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES = 195; // An attempted operation is invalid until all token balances for the target account are zero - ACCOUNT_IS_TREASURY = 196; // An attempted operation is invalid because the account is a treasury - TOKEN_ID_REPEATED_IN_TOKEN_LIST = 197; // Same TokenIDs present in the token list - TOKEN_TRANSFER_LIST_SIZE_LIMIT_EXCEEDED = 198; // Exceeded the number of token transfers (both from and to) allowed for token transfer list - EMPTY_TOKEN_TRANSFER_BODY = 199; // TokenTransfersTransactionBody has no TokenTransferList - EMPTY_TOKEN_TRANSFER_ACCOUNT_AMOUNTS = 200; // TokenTransfersTransactionBody has a TokenTransferList with no AccountAmounts - - INVALID_SCHEDULE_ID = 201; // The Scheduled entity does not exist; or has now expired, been deleted, or been executed - SCHEDULE_IS_IMMUTABLE = 202; // The Scheduled entity cannot be modified. Admin key not set - INVALID_SCHEDULE_PAYER_ID = 203; // The provided Scheduled Payer does not exist - INVALID_SCHEDULE_ACCOUNT_ID = 204; // The Schedule Create Transaction TransactionID account does not exist - NO_NEW_VALID_SIGNATURES = 205; // The provided sig map did not contain any new valid signatures from required signers of the scheduled transaction - UNRESOLVABLE_REQUIRED_SIGNERS = 206; // The required signers for a scheduled transaction cannot be resolved, for example because they do not exist or have been deleted - SCHEDULED_TRANSACTION_NOT_IN_WHITELIST = 207; // Only whitelisted transaction types may be scheduled - SOME_SIGNATURES_WERE_INVALID = 208; // At least one of the signatures in the provided sig map did not represent a valid signature for any required signer - TRANSACTION_ID_FIELD_NOT_ALLOWED = 209; // The scheduled field in the TransactionID may not be set to true - IDENTICAL_SCHEDULE_ALREADY_CREATED = 210; // A schedule already exists with the same identifying fields of an attempted ScheduleCreate (that is, all fields other than scheduledPayerAccountID) - INVALID_ZERO_BYTE_IN_STRING = 211; // A string field in the transaction has a UTF-8 encoding with the prohibited zero byte - SCHEDULE_ALREADY_DELETED = 212; // A schedule being signed or deleted has already been deleted - SCHEDULE_ALREADY_EXECUTED = 213; // A schedule being signed or deleted has already been executed - MESSAGE_SIZE_TOO_LARGE = 214; // ConsensusSubmitMessage request's message size is larger than allowed. - OPERATION_REPEATED_IN_BUCKET_GROUPS = 215; // An operation was assigned to more than one throttle group in a given bucket - BUCKET_CAPACITY_OVERFLOW = 216; // The capacity needed to satisfy all opsPerSec groups in a bucket overflowed a signed 8-byte integral type - NODE_CAPACITY_NOT_SUFFICIENT_FOR_OPERATION = 217; // Given the network size in the address book, the node-level capacity for an operation would never be enough to accept a single request; usually means a bucket burstPeriod should be increased - BUCKET_HAS_NO_THROTTLE_GROUPS = 218; // A bucket was defined without any throttle groups - THROTTLE_GROUP_HAS_ZERO_OPS_PER_SEC = 219; // A throttle group was granted zero opsPerSec - SUCCESS_BUT_MISSING_EXPECTED_OPERATION = 220; // The throttle definitions file was updated, but some supported operations were not assigned a bucket - UNPARSEABLE_THROTTLE_DEFINITIONS = 221; // The new contents for the throttle definitions system file were not valid protobuf - INVALID_THROTTLE_DEFINITIONS = 222; // The new throttle definitions system file were invalid, and no more specific error could be divined - ACCOUNT_EXPIRED_AND_PENDING_REMOVAL = 223; // The transaction references an account which has passed its expiration without renewal funds available, and currently remains in the ledger only because of the grace period given to expired entities - INVALID_TOKEN_MAX_SUPPLY = 224; // Invalid token max supply - INVALID_TOKEN_NFT_SERIAL_NUMBER = 225; // Invalid token nft serial number - INVALID_NFT_ID = 226; // Invalid nft id - METADATA_TOO_LONG = 227; // Nft metadata is too long - BATCH_SIZE_LIMIT_EXCEEDED = 228; // Repeated operations count exceeds the limit - QUERY_RANGE_LIMIT_EXCEEDED = 229; // The range of data to be gathered exceeds the limit -} diff --git a/services/ResponseHeader.proto b/services/ResponseHeader.proto deleted file mode 100644 index c08b0323..00000000 --- a/services/ResponseHeader.proto +++ /dev/null @@ -1,38 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "TransactionResponse.proto"; -import "QueryHeader.proto"; -import "ResponseCode.proto"; - -/* Every query receives a response containing the QueryResponseHeader. Either or both of the cost and stateProof fields may be blank, if the responseType didn't ask for the cost or stateProof. */ -message ResponseHeader { - ResponseCodeEnum nodeTransactionPrecheckCode = 1; // Result of fee transaction precheck, saying it passed, or why it failed - ResponseType responseType = 2; // The requested response is repeated back here, for convenience - uint64 cost = 3; // The fee that would be charged to get the requested information (if a cost was requested). Note: This cost only includes the query fee and does not include the transfer fee(which is required to execute the transfer transaction to debit the payer account and credit the node account with query fee) - bytes stateProof = 4; // The state proof for this information (if a state proof was requested, and is available) -} diff --git a/services/SchedulableTransactionBody.proto b/services/SchedulableTransactionBody.proto deleted file mode 100644 index 41f2b184..00000000 --- a/services/SchedulableTransactionBody.proto +++ /dev/null @@ -1,114 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "SystemDelete.proto"; -import "SystemUndelete.proto"; -import "Freeze.proto"; - -import "ContractCall.proto"; -import "ContractCreate.proto"; -import "ContractUpdate.proto"; - -import "CryptoCreate.proto"; -import "CryptoDelete.proto"; -import "CryptoTransfer.proto"; -import "CryptoUpdate.proto"; - -import "FileAppend.proto"; -import "FileCreate.proto"; -import "FileDelete.proto"; -import "FileUpdate.proto"; - -import "ContractDelete.proto"; - -import "ConsensusCreateTopic.proto"; -import "ConsensusUpdateTopic.proto"; -import "ConsensusDeleteTopic.proto"; -import "ConsensusSubmitMessage.proto"; - -import "TokenCreate.proto"; -import "TokenFreezeAccount.proto"; -import "TokenUnfreezeAccount.proto"; -import "TokenGrantKyc.proto"; -import "TokenRevokeKyc.proto"; -import "TokenDelete.proto"; -import "TokenUpdate.proto"; -import "TokenMint.proto"; -import "TokenBurn.proto"; -import "TokenWipeAccount.proto"; -import "TokenAssociate.proto"; -import "TokenDissociate.proto"; - -import "ScheduleDelete.proto"; - -/* A schedulable transaction. Note that the global/dynamic system property -scheduling.whitelist controls which transaction types may be scheduled. -In Hedera Services 0.13.0, it will include only CryptoTransfer and -ConsensusSubmitMessage functions. */ -message SchedulableTransactionBody { - uint64 transactionFee = 1; // The maximum transaction fee the client is willing to pay - string memo = 2; // A memo to include the execution record; the UTF-8 encoding may be up to 100 bytes and must not include the zero byte - oneof data { - ContractCallTransactionBody contractCall = 3; // Calls a function of a contract instance - ContractCreateTransactionBody contractCreateInstance = 4; // Creates a contract instance - ContractUpdateTransactionBody contractUpdateInstance = 5; // Updates a contract - ContractDeleteTransactionBody contractDeleteInstance = 6; //Delete contract and transfer remaining balance into specified account - - CryptoCreateTransactionBody cryptoCreateAccount = 7; // Create a new cryptocurrency account - CryptoDeleteTransactionBody cryptoDelete = 8; // Delete a cryptocurrency account (mark as deleted, and transfer hbars out) - CryptoTransferTransactionBody cryptoTransfer = 9; // Transfer amount between accounts - CryptoUpdateTransactionBody cryptoUpdateAccount = 10; // Modify information such as the expiration date for an account - - FileAppendTransactionBody fileAppend = 11; // Add bytes to the end of the contents of a file - FileCreateTransactionBody fileCreate = 12; // Create a new file - FileDeleteTransactionBody fileDelete = 13; // Delete a file (remove contents and mark as deleted until it expires) - FileUpdateTransactionBody fileUpdate = 14; // Modify information such as the expiration date for a file - SystemDeleteTransactionBody systemDelete = 15; // Hedera administrative deletion of a file or smart contract - SystemUndeleteTransactionBody systemUndelete = 16; //To undelete an entity deleted by SystemDelete - FreezeTransactionBody freeze = 17; // Freeze the nodes - - ConsensusCreateTopicTransactionBody consensusCreateTopic = 18; // Creates a topic - ConsensusUpdateTopicTransactionBody consensusUpdateTopic = 19; // Updates a topic - ConsensusDeleteTopicTransactionBody consensusDeleteTopic = 20; // Deletes a topic - ConsensusSubmitMessageTransactionBody consensusSubmitMessage = 21; // Submits message to a topic - - TokenCreateTransactionBody tokenCreation = 22; // Creates a token instance - TokenFreezeAccountTransactionBody tokenFreeze = 23; // Freezes account not to be able to transact with a token - TokenUnfreezeAccountTransactionBody tokenUnfreeze = 24; // Unfreezes account for a token - TokenGrantKycTransactionBody tokenGrantKyc = 25; // Grants KYC to an account for a token - TokenRevokeKycTransactionBody tokenRevokeKyc = 26; // Revokes KYC of an account for a token - TokenDeleteTransactionBody tokenDeletion = 27; // Deletes a token instance - TokenUpdateTransactionBody tokenUpdate = 28; // Updates a token instance - TokenMintTransactionBody tokenMint = 29; // Mints new tokens to a token's treasury account - TokenBurnTransactionBody tokenBurn = 30; // Burns tokens from a token's treasury account - TokenWipeAccountTransactionBody tokenWipe = 31; // Wipes amount of tokens from an account - TokenAssociateTransactionBody tokenAssociate = 32; // Associate tokens to an account - TokenDissociateTransactionBody tokenDissociate = 33; // Dissociate tokens from an account - - ScheduleDeleteTransactionBody scheduleDelete = 34; // Marks a schedule in the network's action queue as deleted, preventing it from executing - } -} diff --git a/services/ScheduleCreate.proto b/services/ScheduleCreate.proto deleted file mode 100644 index 946e8077..00000000 --- a/services/ScheduleCreate.proto +++ /dev/null @@ -1,67 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "SchedulableTransactionBody.proto"; - -/* -Create a new schedule entity (or simply, schedule) in the network's action queue. Upon SUCCESS, the receipt contains -the `ScheduleID` of the created schedule. A schedule entity includes a scheduledTransactionBody to be executed when the schedule -has collected enough signing Ed25519 keys to satisfy the scheduled transaction's signing requirements. Upon `SUCCESS`, the receipt also -includes the scheduledTransactionID to use to query for the record of the scheduled transaction's execution (if it occurs). - -The expiration time of a schedule is always 30 minutes; it remains in state and can be queried using GetScheduleInfo until expiration, -no matter if the scheduled transaction has executed or marked deleted. - -If the adminKey field is omitted, the resulting schedule is immutable. If the adminKey is set, the ScheduleDelete -transaction can be used to mark it as deleted. The creator may also specify an optional memo whose UTF-8 encoding is at most 100 -bytes and does not include the zero byte is also supported. - -When a scheduled transaction whose schedule has collected enough signing keys is executed, the network only charges its payer the service fee, -and not the node and network fees. If the optional payerAccountID is set, the network charges this account. Otherwise it charges the -payer of the originating ScheduleCreate. - -Two ScheduleCreate transactions are identical if they are equal in all their fields other than payerAccountID. -(Here "equal" should be understood in the sense of gRPC object equality in the network software runtime. In particular, a gRPC object with -unknown fields is not equal to a gRPC object without -unknown fields, even if they agree on all known fields.) - -A ScheduleCreate transaction that attempts to re-create an identical schedule already in state will receive a receipt with status -IDENTICAL_SCHEDULE_ALREADY_CREATED; the receipt will include the ScheduleID of the extant schedule, which may be -used in a subsequent ScheduleSign transaction. (The receipt will also include the TransactionID to use in querying -for the receipt or record of the scheduled transaction.) - -Other notable response codes include, INVALID_ACCOUNT_ID, UNSCHEDULABLE_TRANSACTION, UNRESOLVABLE_REQUIRED_SIGNERS, -INVALID_SIGNATURE. For more information please see the section of this documentation on the ResponseCode enum. -*/ - -message ScheduleCreateTransactionBody { - SchedulableTransactionBody scheduledTransactionBody = 1; // The scheduled transaction - string memo = 2; // An optional memo with a UTF-8 encoding of no more than 100 bytes which does not contain the zero byte - Key adminKey = 3; // An optional Hedera key which can be used to sign a ScheduleDelete and remove the schedule - AccountID payerAccountID = 4; // An optional id of the account to be charged the service fee for the scheduled transaction at the consensus time that it executes (if ever); defaults to the ScheduleCreate payer if not given -} diff --git a/services/ScheduleGetInfo.proto b/services/ScheduleGetInfo.proto deleted file mode 100644 index e2499774..00000000 --- a/services/ScheduleGetInfo.proto +++ /dev/null @@ -1,69 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "Timestamp.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; -import "SchedulableTransactionBody.proto"; - -/* -Gets information about a schedule in the network's action queue. - -Responds with INVALID_SCHEDULE_ID if the requested schedule doesn't exist. -*/ -message ScheduleGetInfoQuery { - QueryHeader header = 1; // standard info sent from client to node including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). - ScheduleID scheduleID = 2; // The id of the schedule to interrogate -} - -/* - Information summarizing schedule state -*/ -message ScheduleInfo { - ScheduleID scheduleID = 1; // The id of the schedule - oneof data { - Timestamp deletion_time = 2; // If the schedule has been deleted, the consensus time when this occurred - Timestamp execution_time = 3; // If the schedule has been executed, the consensus time when this occurred - } - Timestamp expirationTime = 4; // The time at which the schedule will expire - SchedulableTransactionBody scheduledTransactionBody = 5; // The scheduled transaction - string memo = 6; // The publicly visible memo of the schedule - Key adminKey = 7; // The key used to delete the schedule from state - KeyList signers = 8; // The Ed25519 keys the network deems to have signed the scheduled transaction - AccountID creatorAccountID = 9; // The id of the account that created the schedule - AccountID payerAccountID = 10; // The id of the account responsible for the service fee of the scheduled transaction - TransactionID scheduledTransactionID = 11; // The transaction id that will be used in the record of the scheduled transaction (if it executes) -} - -/* -Response wrapper for the ScheduleInfo -*/ -message ScheduleGetInfoResponse { - ResponseHeader header = 1; // Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - ScheduleInfo scheduleInfo = 2; // The information requested about this schedule instance -} diff --git a/services/ScheduleService.proto b/services/ScheduleService.proto deleted file mode 100644 index 25a5425e..00000000 --- a/services/ScheduleService.proto +++ /dev/null @@ -1,59 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.service.proto.java"; - -import "Query.proto"; -import "Response.proto"; -import "TransactionResponse.proto"; -import "Transaction.proto"; - -/* -Transactions and queries for the Schedule Service -The Schedule Service allows transactions to be submitted without all the required signatures and allows anyone to provide the required signatures independently after a transaction has already been created. -Execution: -Scheduled Transactions are executed once all required signatures are collected and witnessed. Every time new signature is provided, a check is performed on the "readiness" of the execution. -The Scheduled Transaction will be executed immediately after the transaction that triggered it and will be externalised in a separate Transaction Record. -Transaction Record: -The timestamp of the Scheduled Transaction will be equal to consensusTimestamp + 1 nano, where consensusTimestamp is the timestamp of the transaction that triggered the execution. -The Transaction ID of the Scheduled Transaction will have the scheduled property set to true and inherit the transactionValidStart and accountID from the ScheduleCreate transaction. -The scheduleRef property of the transaction record will be populated with the ScheduleID of the Scheduled Transaction. -Post execution: -Once a given Scheduled Transaction executes, it will be removed from the ledger and any upcoming operation referring the ScheduleID will resolve to INVALID_SCHEDULE_ID. -Expiry: -Scheduled Transactions have a global expiry time txExpiryTimeSecs (Currently set to 30 minutes). If txExpiryTimeSecs pass and the Scheduled Transaction haven't yet executed, it will be removed from the ledger as if ScheduleDelete operation is executed. -*/ -service ScheduleService { - // Creates a new Schedule by submitting the transaction - rpc createSchedule (Transaction) returns (TransactionResponse); - - // Signs a new Schedule by submitting the transaction - rpc signSchedule (Transaction) returns (TransactionResponse); - - // Deletes a new Schedule by submitting the transaction - rpc deleteSchedule (Transaction) returns (TransactionResponse); - - // Retrieves the metadata of a schedule entity - rpc getScheduleInfo (Query) returns (Response); -} diff --git a/services/ScheduleSign.proto b/services/ScheduleSign.proto deleted file mode 100644 index 33633269..00000000 --- a/services/ScheduleSign.proto +++ /dev/null @@ -1,43 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; - -/* -Adds zero or more signing keys to a schedule. If the resulting set of signing keys satisfy the scheduled -transaction's signing requirements, it will be executed immediately after the triggering ScheduleSign. - -Upon SUCCESS, the receipt includes the scheduledTransactionID to use to query for the -record of the scheduled transaction's execution (if it occurs). - -Other notable response codes include INVALID_SCHEDULE_ID, SCHEDULE_WAS_DELETD, -INVALID_ACCOUNT_ID, UNRESOLVABLE_REQUIRED_SIGNERS, SOME_SIGNATURES_WERE_INVALID, -and NO_NEW_VALID_SIGNATURES. For more information please see the section of this -documentation on the ResponseCode enum. */ -message ScheduleSignTransactionBody { - ScheduleID scheduleID = 1; // The id of the schedule to add signing keys to -} diff --git a/services/SystemDelete.proto b/services/SystemDelete.proto deleted file mode 100644 index 6f5f5ce2..00000000 --- a/services/SystemDelete.proto +++ /dev/null @@ -1,40 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "Timestamp.proto"; - -/* -Delete a file or smart contract - can only be done with a Hedera administrative multisignature. When it is deleted, it immediately disappears from the system as seen by the user, but is still stored internally until the expiration time, at which time it is truly and permanently deleted. Until that time, it can be undeleted by the Hedera administrative multisignature. When a smart contract is deleted, the cryptocurrency account within it continues to exist, and is not affected by the expiration time here. -*/ -message SystemDeleteTransactionBody { - oneof id { - FileID fileID = 1; // The file ID of the file to delete, in the format used in transactions - ContractID contractID = 2; // The contract ID instance to delete, in the format used in transactions - } - TimestampSeconds expirationTime = 3; // The timestamp in seconds at which the "deleted" file should truly be permanently deleted -} diff --git a/services/ThrottleDefinitions.proto b/services/ThrottleDefinitions.proto deleted file mode 100644 index 08947999..00000000 --- a/services/ThrottleDefinitions.proto +++ /dev/null @@ -1,55 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; - -/* For details behind this throttling design, please see the docs/throttle-design.md -document in the Hedera Services repository. */ - -/* A set of operations which should be collectively throttled at a given milli-ops-per-second limit. */ -message ThrottleGroup { - repeated HederaFunctionality operations = 1; // The operations to be throttled - uint64 milliOpsPerSec = 2; // The number of total operations per second across the entire network, multiplied by 1000. So, to choose 3 operations per second (which on a network of 30 nodes is a tenth of an operation per second for each node), set milliOpsPerSec = 3000. And to choose 3.6 ops per second, use milliOpsPerSec = 3600. Minimum allowed value is 1, and maximum allowed value is 9223372. -} - -/* A list of throttle groups that should all compete for the same internal bucket. */ -message ThrottleBucket { - string name = 1; // A name for this bucket (primarily for use in logs) - uint64 burstPeriodMs = 2; // The number of milliseconds required for this bucket to drain completely when full. The product of this number and the least common multiple of the milliOpsPerSec values in this bucket must not exceed 9223372036. - repeated ThrottleGroup throttleGroups = 3; // The throttle groups competing for this bucket -} - -/* A list of throttle buckets which, simultaneously enforced, define the system's throttling policy. -
    -
  1. When an operation appears in more than one throttling bucket, all its buckets must have room -or it will be throttled.
  2. -
  3. An operation assigned to no buckets is always throttled.
  4. -
-*/ -message ThrottleDefinitions { - repeated ThrottleBucket throttleBuckets = 1; -} diff --git a/services/TokenAssociate.proto b/services/TokenAssociate.proto deleted file mode 100644 index 51b4ef20..00000000 --- a/services/TokenAssociate.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; - -/* Associates the provided account with the provided tokens. Must be signed by the provided Account's key. - If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID. - If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED. - If any of the provided tokens is not found, the transaction will resolve to INVALID_TOKEN_REF. - If any of the provided tokens has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. - If an association between the provided account and any of the tokens already exists, the transaction will resolve to TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT. - If the provided account's associations count exceed the constraint of maximum token associations per account, the transaction will resolve to TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED. - On success, associations between the provided account and tokens are made and the account is ready to interact with the tokens. - */ -message TokenAssociateTransactionBody { - AccountID account = 1; // The account to be associated with the provided tokens - repeated TokenID tokens = 2; // The tokens to be associated with the provided account. In the case of NON_FUNGIBLE_UNIQUE Type, once an account is associated, it can hold any number of NFTs (serial numbers) of that token type -} diff --git a/services/TokenBurn.proto b/services/TokenBurn.proto deleted file mode 100644 index 320edc9b..00000000 --- a/services/TokenBurn.proto +++ /dev/null @@ -1,40 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; - -/* -Burns tokens from the Token's treasury Account. If no Supply Key is defined, the transaction will resolve to TOKEN_HAS_NO_SUPPLY_KEY. -The operation decreases the Total Supply of the Token. Total supply cannot go below zero. -The amount provided must be in the lowest denomination possible. Example: -Token A has 2 decimals. In order to burn 100 tokens, one must provide amount of 10000. In order to burn 100.55 tokens, one must provide amount of 10055. - */ -message TokenBurnTransactionBody { - TokenID token = 1; // The token for which to burn tokens. If token does not exist, transaction results in INVALID_TOKEN_ID - uint64 amount = 2; // Applicable to tokens of type FUNGIBLE_COMMON. The amount to burn from the Treasury Account. Amount must be a positive non-zero number, not bigger than the token balance of the treasury account (0; balance], represented in the lowest denomination. - repeated int64 serialNumbers = 3; // Applicable to tokens of type NON_FUNGIBLE_UNIQUE. The list of serial numbers to be burned. -} diff --git a/services/TokenCreate.proto b/services/TokenCreate.proto deleted file mode 100644 index f076cb5e..00000000 --- a/services/TokenCreate.proto +++ /dev/null @@ -1,65 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "Duration.proto"; -import "BasicTypes.proto"; -import "Timestamp.proto"; - -/* -Create a new token. After the token is created, the Token ID for it is in the receipt. -The specified Treasury Account is receiving the initial supply of tokens as-well as the tokens from the Token Mint operation once executed. The balance of the treasury account is decreased when the Token Burn operation is executed. - -The initialSupply is the initial supply of the smallest parts of a token (like a tinybar, not an hbar). These are the smallest units of the token which may be transferred. - -The supply can change over time. If the total supply at some moment is S parts of tokens, and the token is using D decimals, then S must be less than or equal to 263-1, which is 9,223,372,036,854,775,807. The number of whole tokens (not parts) will be S / 10D. - -If decimals is 8 or 11, then the number of whole tokens can be at most a few billions or millions, respectively. For example, it could match Bitcoin (21 million whole tokens with 8 decimals) or hbars (50 billion whole tokens with 8 decimals). It could even match Bitcoin with milli-satoshis (21 million whole tokens with 11 decimals). - -Note that a created token is immutable if the adminKey is omitted. No property of an immutable token can ever change, with the sole exception of its expiry. Anyone can pay to extend the expiry time of an immutable token. - */ -message TokenCreateTransactionBody { - string name = 1; // The publicly visible name of the token, limited to a UTF-8 encoding of length tokens.maxSymbolUtf8Bytes. - string symbol = 2; // The publicly visible token symbol, limited to a UTF-8 encoding of length tokens.maxTokenNameUtf8Bytes. - uint32 decimals = 3; // For tokens of type FUNGIBLE_COMMON - the number of decimal places a token is divisible by. For tokens of type NON_FUNGIBLE_UNIQUE - value must be 0 - uint64 initialSupply = 4; // Specifies the initial supply of tokens to be put in circulation. The initial supply is sent to the Treasury Account. The supply is in the lowest denomination possible. In the case for NON_FUNGIBLE_UNIQUE Type the value must be 0 - AccountID treasury = 5; // The account which will act as a treasury for the token. This account will receive the specified initial supply or the newly minted NFTs in the case for NON_FUNGIBLE_UNIQUE Type - Key adminKey = 6; // The key which can perform update/delete operations on the token. If empty, the token can be perceived as immutable (not being able to be updated/deleted) - Key kycKey = 7; // The key which can grant or revoke KYC of an account for the token's transactions. If empty, KYC is not required, and KYC grant or revoke operations are not possible. - Key freezeKey = 8; // The key which can sign to freeze or unfreeze an account for token transactions. If empty, freezing is not possible - Key wipeKey = 9; // The key which can wipe the token balance of an account. If empty, wipe is not possible - Key supplyKey = 10; // The key which can change the supply of a token. The key is used to sign Token Mint/Burn operations - bool freezeDefault = 11; // The default Freeze status (frozen or unfrozen) of Hedera accounts relative to this token. If true, an account must be unfrozen before it can receive the token - Timestamp expiry = 13; // The epoch second at which the token should expire; if an auto-renew account and period are specified, this is coerced to the current epoch second plus the autoRenewPeriod - AccountID autoRenewAccount = 14; // An account which will be automatically charged to renew the token's expiration, at autoRenewPeriod interval - Duration autoRenewPeriod = 15; // The interval at which the auto-renew account will be charged to extend the token's expiry - string memo = 16; // The memo associated with the token (UTF-8 encoding max 100 bytes) - TokenType tokenType = 17; // IWA compatibility. Specifies the token type. Defaults to FUNGIBLE_COMMON - TokenSupplyType supplyType = 18; // IWA compatibility. Specified the token supply type. Defaults to INFINITE - int64 maxSupply = 19; // IWA Compatibility. Depends on TokenSupplyType. For tokens of type FUNGIBLE_COMMON - the maximum number of tokens that can be in circulation. For tokens of type NON_FUNGIBLE_UNIQUE - the maximum number of NFTs (serial numbers) that can be minted. This field can never be changed! - repeated CustomTransferFeeInTokens customFeeInTokens = 20; // Custom fee in Token Units that needs to be paid to the specified receiver on a TokenTransfer - repeated CustomTransferFeeInHbar customFeeInHbar = 21;// Custom fee in hbar that needs to be paid to the specified receiver on a TokenTransfer -} diff --git a/services/TokenDissociate.proto b/services/TokenDissociate.proto deleted file mode 100644 index 9a1a14bb..00000000 --- a/services/TokenDissociate.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; - -/* Dissociates the provided account with the provided tokens. Must be signed by the provided Account's key. - If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID. - If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED. - If any of the provided tokens is not found, the transaction will resolve to INVALID_TOKEN_REF. - If any of the provided tokens has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. - If an association between the provided account and any of the tokens does not exist, the transaction will resolve to TOKEN_NOT_ASSOCIATED_TO_ACCOUNT. - If the provided account has a nonzero balance with any of the provided tokens, the transaction will resolve to TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES. - On success, associations between the provided account and tokens are removed. - */ -message TokenDissociateTransactionBody { - AccountID account = 1; // The account to be dissociated with the provided tokens - repeated TokenID tokens = 2; // The tokens to be dissociated with the provided account -} diff --git a/services/TokenFreezeAccount.proto b/services/TokenFreezeAccount.proto deleted file mode 100644 index 3d49b9b4..00000000 --- a/services/TokenFreezeAccount.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; - -/* Freezes transfers of the specified token for the account. Must be signed by the Token's freezeKey. - If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID. - If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED. - If the provided token is not found, the transaction will resolve to INVALID_TOKEN_ID. - If the provided token has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. - If an Association between the provided token and account is not found, the transaction will resolve to TOKEN_NOT_ASSOCIATED_TO_ACCOUNT. - If no Freeze Key is defined, the transaction will resolve to TOKEN_HAS_NO_FREEZE_KEY. - Once executed the Account is marked as Frozen and will not be able to receive or send tokens unless unfrozen. The operation is idempotent. - */ -message TokenFreezeAccountTransactionBody { - TokenID token = 1; // The token for which this account will be frozen. If token does not exist, transaction results in INVALID_TOKEN_ID - AccountID account = 2; // The account to be frozen -} diff --git a/services/TokenGetAccountNftInfo.proto b/services/TokenGetAccountNftInfo.proto deleted file mode 100644 index 9caf68de..00000000 --- a/services/TokenGetAccountNftInfo.proto +++ /dev/null @@ -1,46 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "TokenGetNftInfo.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; - -/* Applicable only to tokens of type NON_FUNGIBLE_UNIQUE. Gets info on NFTs N through M owned by the specified accountId. - * Example: If Account A owns 5 NFTs (might be of different Token Entity), having start=0 and end=5 will return all of the NFTs - */ -message TokenGetAccountNftInfoQuery { - QueryHeader header = 1; // Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). - AccountID accountID = 2; // The Account for which information is requested - int64 start = 3; // Specifies the start index (inclusive) of the range of NFTs to query for. Value must be in the range [0; ownedNFTs-1] - int64 end = 4; // Specifies the end index (exclusive) of the range of NFTs to query for. Value must be in the range (start; ownedNFTs] -} - -message TokenGetAccountNftInfoResponse { - ResponseHeader header = 1; // Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - repeated TokenNftInfo nfts = 2; // List of NFTs associated to the account -} diff --git a/services/TokenGetInfo.proto b/services/TokenGetInfo.proto deleted file mode 100644 index 229448c4..00000000 --- a/services/TokenGetInfo.proto +++ /dev/null @@ -1,71 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; -import "Timestamp.proto"; -import "Duration.proto"; - -/* Gets information about Token instance */ -message TokenGetInfoQuery { - QueryHeader header = 1; // Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither) - TokenID token = 2; // The token for which information is requested. If invalid token is provided, INVALID_TOKEN_ID response is returned. -} - -/* The metadata about a Token instance */ -message TokenInfo { - TokenID tokenId = 1; // ID of the token instance - string name = 2; // The name of the token. It is a string of ASCII only characters - string symbol = 3; // The symbol of the token. It is a UTF-8 capitalized alphabetical string - uint32 decimals = 4; // The number of decimal places a token is divisible by. Always 0 for tokens of type NON_FUNGIBLE_UNIQUE - uint64 totalSupply = 5; // For tokens of type FUNGIBLE_COMMON - the total supply of tokens that are currently in circulation. For tokens of type NON_FUNGIBLE_UNIQUE - the number of NFTs created of this token instance - AccountID treasury = 6; // The ID of the account which is set as Treasury - Key adminKey = 7; // The key which can perform update/delete operations on the token. If empty, the token can be perceived as immutable (not being able to be updated/deleted) - Key kycKey = 8; // The key which can grant or revoke KYC of an account for the token's transactions. If empty, KYC is not required, and KYC grant or revoke operations are not possible. - Key freezeKey = 9; // The key which can freeze or unfreeze an account for token transactions. If empty, freezing is not possible - Key wipeKey = 10; // The key which can wipe token balance of an account. If empty, wipe is not possible - Key supplyKey = 11; // The key which can change the supply of a token. The key is used to sign Token Mint/Burn operations - TokenFreezeStatus defaultFreezeStatus = 12; // The default Freeze status (not applicable, frozen or unfrozen) of Hedera accounts relative to this token. FreezeNotApplicable is returned if Token Freeze Key is empty. Frozen is returned if Token Freeze Key is set and defaultFreeze is set to true. Unfrozen is returned if Token Freeze Key is set and defaultFreeze is set to false - TokenKycStatus defaultKycStatus = 13; // The default KYC status (KycNotApplicable or Revoked) of Hedera accounts relative to this token. KycNotApplicable is returned if KYC key is not set, otherwise Revoked - bool deleted = 14; // Specifies whether the token was deleted or not - AccountID autoRenewAccount = 15; // An account which will be automatically charged to renew the token's expiration, at autoRenewPeriod interval - Duration autoRenewPeriod = 16; // The interval at which the auto-renew account will be charged to extend the token's expiry - Timestamp expiry = 17; // The epoch second at which the token will expire - string memo = 18; // The memo associated with the token - TokenType tokenType = 19; // The token type - TokenSupplyType supplyType = 20; // The token supply type - int64 maxSupply = 21; // For tokens of type FUNGIBLE_COMMON - The Maximum number of fungible tokens that can be in circulation. For tokens of type NON_FUNGIBLE_UNIQUE - the maximum number of NFTs (serial numbers) that can be in circulation - repeated CustomTransferFeeInTokens customFeeInTokens = 22; // Custom fee in Token Units that needs to be paid to the specified receiver on a TokenTransfer - repeated CustomTransferFeeInHbar customFeeInHbar = 23;// Custom fee in hbar that needs to be paid to the specified receiver on a TokenTransfer -} - -/* Response when the client sends the node TokenGetInfoQuery */ -message TokenGetInfoResponse { - ResponseHeader header = 1; // Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - TokenInfo tokenInfo = 2; // The information requested about this token instance -} diff --git a/services/TokenGetNftInfo.proto b/services/TokenGetNftInfo.proto deleted file mode 100644 index d7376d7f..00000000 --- a/services/TokenGetNftInfo.proto +++ /dev/null @@ -1,55 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; -import "Timestamp.proto"; - -/* Represents an NFT on the Ledger */ -message NftID { - TokenID tokenID = 1; // The (non-fungible) token of which this NFT is an instance - int64 serialNumber = 2; // The unique identifier of this instance -} - -/* Applicable only to tokens of type NON_FUNGIBLE_UNIQUE. Gets info on a NFT for a given TokenID (of type NON_FUNGIBLE_UNIQUE) and serial number */ -message TokenGetNftInfoQuery { - QueryHeader header = 1; // Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). - NftID nftID = 2; // The ID of the NFT -} - -message TokenNftInfo { - NftID nftID = 1; // The ID of the NFT - AccountID accountID = 2; // The current owner of the NFT - Timestamp creationTime = 3; // The effective consensus timestamp at which the NFT was minted - bytes metadata = 4; // Represents the unique metadata of the NFT -} - -message TokenGetNftInfoResponse { - ResponseHeader header = 1; // Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - TokenNftInfo nft = 2; // The information about this NFT -} diff --git a/services/TokenGetNftInfos.proto b/services/TokenGetNftInfos.proto deleted file mode 100644 index 8cc438b9..00000000 --- a/services/TokenGetNftInfos.proto +++ /dev/null @@ -1,47 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "TokenGetNftInfo.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; - -/* Applicable only to tokens of type NON_FUNGIBLE_UNIQUE. Gets info on NFTs N through M on the list of NFTs associated with a given NON_FUNGIBLE_UNIQUE Token. - * Example: If there are 10 NFTs issued, having start=0 and end=5 will query for the first 5 NFTs. Querying +all 10 NFTs will require start=0 and end=10 - */ -message TokenGetNftInfosQuery { - QueryHeader header = 1; // Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). - TokenID tokenID = 2; // The ID of the token for which information is requested - int64 start = 3; // Specifies the start index (inclusive) of the range of NFTs to query for. Value must be in the range [0; ownedNFTs-1] - int64 end = 4; // Specifies the end index (exclusive) of the range of NFTs to query for. Value must be in the range (start; ownedNFTs] -} - -message TokenGetNftInfosResponse { - ResponseHeader header = 1; // Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - TokenID tokenID = 2; // The Token with type NON_FUNGIBLE that this record is for - repeated TokenNftInfo nfts = 3; // List of NFTs associated to the specified token -} diff --git a/services/TokenGrantKyc.proto b/services/TokenGrantKyc.proto deleted file mode 100644 index 1156b41b..00000000 --- a/services/TokenGrantKyc.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; - -/* Grants KYC to the account for the given token. Must be signed by the Token's kycKey. - If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID. - If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED. - If the provided token is not found, the transaction will resolve to INVALID_TOKEN_ID. - If the provided token has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. - If an Association between the provided token and account is not found, the transaction will resolve to TOKEN_NOT_ASSOCIATED_TO_ACCOUNT. - If no KYC Key is defined, the transaction will resolve to TOKEN_HAS_NO_KYC_KEY. - Once executed the Account is marked as KYC Granted. - */ -message TokenGrantKycTransactionBody { - TokenID token = 1; // The token for which this account will be granted KYC. If token does not exist, transaction results in INVALID_TOKEN_ID - AccountID account = 2; // The account to be KYCed -} diff --git a/services/TokenMint.proto b/services/TokenMint.proto deleted file mode 100644 index 756b7021..00000000 --- a/services/TokenMint.proto +++ /dev/null @@ -1,40 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; - -/* -Mints tokens to the Token's treasury Account. If no Supply Key is defined, the transaction will resolve to TOKEN_HAS_NO_SUPPLY_KEY. -The operation increases the Total Supply of the Token. The maximum total supply a token can have is 2^63-1. -The amount provided must be in the lowest denomination possible. Example: -Token A has 2 decimals. In order to mint 100 tokens, one must provide amount of 10000. In order to mint 100.55 tokens, one must provide amount of 10055. - */ -message TokenMintTransactionBody { - TokenID token = 1; // The token for which to mint tokens. If token does not exist, transaction results in INVALID_TOKEN_ID - uint64 amount = 2; // Applicable to tokens of type FUNGIBLE_COMMON. The amount to mint to the Treasury Account. Amount must be a positive non-zero number represented in the lowest denomination of the token. The new supply must be lower than 2^63. - repeated bytes metadata = 3; // Applicable to tokens of type NON_FUNGIBLE_UNIQUE. A list of metadata that are being created. Maximum allowed size of each metadata is 100 bytes -} diff --git a/services/TokenRevokeKyc.proto b/services/TokenRevokeKyc.proto deleted file mode 100644 index 4e780dc3..00000000 --- a/services/TokenRevokeKyc.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; - -/* Revokes KYC to the account for the given token. Must be signed by the Token's kycKey. - If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID. - If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED. - If the provided token is not found, the transaction will resolve to INVALID_TOKEN_ID. - If the provided token has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. - If an Association between the provided token and account is not found, the transaction will resolve to TOKEN_NOT_ASSOCIATED_TO_ACCOUNT. - If no KYC Key is defined, the transaction will resolve to TOKEN_HAS_NO_KYC_KEY. - Once executed the Account is marked as KYC Revoked - */ -message TokenRevokeKycTransactionBody { - TokenID token = 1; // The token for which this account will get his KYC revoked. If token does not exist, transaction results in INVALID_TOKEN_ID - AccountID account = 2; // The account to be KYC Revoked -} diff --git a/services/TokenService.proto b/services/TokenService.proto deleted file mode 100644 index aa5ef7db..00000000 --- a/services/TokenService.proto +++ /dev/null @@ -1,67 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.service.proto.java"; - -import "Query.proto"; -import "Response.proto"; -import "TransactionResponse.proto"; -import "Transaction.proto"; - -/* Transactions and queries for the Token Service */ -service TokenService { - // Creates a new Token by submitting the transaction - rpc createToken (Transaction) returns (TransactionResponse); - // Updates the account by submitting the transaction - rpc updateToken (Transaction) returns (TransactionResponse); - // Mints an amount of the token to the defined treasury account - rpc mintToken (Transaction) returns (TransactionResponse); - // Burns an amount of the token from the defined treasury account - rpc burnToken (Transaction) returns (TransactionResponse); - // Deletes a Token - rpc deleteToken (Transaction) returns (TransactionResponse); - // Wipes the provided amount of tokens from the specified Account ID - rpc wipeTokenAccount (Transaction) returns (TransactionResponse); - // Freezes the transfer of tokens to or from the specified Account ID - rpc freezeTokenAccount (Transaction) returns (TransactionResponse); - // Unfreezes the transfer of tokens to or from the specified Account ID - rpc unfreezeTokenAccount (Transaction) returns (TransactionResponse); - // Flags the provided Account ID as having gone through KYC - rpc grantKycToTokenAccount (Transaction) returns (TransactionResponse); - // Removes the KYC flag of the provided Account ID - rpc revokeKycFromTokenAccount (Transaction) returns (TransactionResponse); - // Associates tokens to an account - rpc associateTokens (Transaction) returns (TransactionResponse); - // Dissociates tokens from an account - rpc dissociateTokens (Transaction) returns (TransactionResponse); - - // Retrieves the metadata of a token - rpc getTokenInfo (Query) returns (Response); - // Gets info on NFTs N through M on the list of NFTs associated with a given account - rpc getAccountNftInfo (Query) returns (Response); - // Retrieves the metadata of an NFT by TokenID and serial number - rpc getTokenNftInfo (Query) returns (Response); - // Gets info on NFTs N through M on the list of NFTs associated with a given Token of type NON_FUNGIBLE - rpc getTokenNftInfos (Query) returns (Response); -} diff --git a/services/TokenUnfreezeAccount.proto b/services/TokenUnfreezeAccount.proto deleted file mode 100644 index 9676e1e5..00000000 --- a/services/TokenUnfreezeAccount.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; - -/* Unfreezes transfers of the specified token for the account. Must be signed by the Token's freezeKey. - If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID. - If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED. - If the provided token is not found, the transaction will resolve to INVALID_TOKEN_ID. - If the provided token has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. - If an Association between the provided token and account is not found, the transaction will resolve to TOKEN_NOT_ASSOCIATED_TO_ACCOUNT. - If no Freeze Key is defined, the transaction will resolve to TOKEN_HAS_NO_FREEZE_KEY. - Once executed the Account is marked as Unfrozen and will be able to receive or send tokens. The operation is idempotent. - */ -message TokenUnfreezeAccountTransactionBody { - TokenID token = 1; // The token for which this account will be unfrozen. If token does not exist, transaction results in INVALID_TOKEN_ID - AccountID account = 2; // The account to be unfrozen -} diff --git a/services/TokenUpdate.proto b/services/TokenUpdate.proto deleted file mode 100644 index 9837bc29..00000000 --- a/services/TokenUpdate.proto +++ /dev/null @@ -1,58 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "Duration.proto"; -import "Timestamp.proto"; -import "google/protobuf/wrappers.proto"; - -/* At consensus, updates an already created token to the given values. - -If no value is given for a field, that field is left unchanged. For an immutable tokens (that is, a token without an admin key), only the expiry may be updated. Setting any other field in that case will cause the transaction status to resolve to TOKEN_IS_IMMUTABLE. - ---- Signing Requirements --- -1. Whether or not a token has an admin key, its expiry can be extended with only the transaction payer's signature. -2. Updating any other field of a mutable token requires the admin key's signature. -3. If a new admin key is set, this new key must sign unless it is exactly an empty KeyList. This special sentinel key removes the existing admin key and causes the token to become immutable. (Other Key structures without a constituent Ed25519 key will be rejected with INVALID_ADMIN_KEY.) -4. If a new treasury is set, the new treasury account's key must sign the transaction. */ -message TokenUpdateTransactionBody { - TokenID token = 1; // The Token to be updated - string symbol = 2; // The new publicly visible Token symbol, limited to a UTF-8 encoding of length tokens.maxTokenNameUtf8Bytes. - string name = 3; // The new publicly visible name of the Token, limited to a UTF-8 encoding of length tokens.maxSymbolUtf8Bytes. - AccountID treasury = 4; // The new Treasury account of the Token. If the provided treasury account is not existing or deleted, the response will be INVALID_TREASURY_ACCOUNT_FOR_TOKEN. If successful, the Token balance held in the previous Treasury Account is transferred to the new one. - Key adminKey = 5; // The new admin key of the Token. If Token is immutable, transaction will resolve to TOKEN_IS_IMMUTABlE. - Key kycKey = 6; // The new KYC key of the Token. If Token does not have currently a KYC key, transaction will resolve to TOKEN_HAS_NO_KYC_KEY. - Key freezeKey = 7; // The new Freeze key of the Token. If the Token does not have currently a Freeze key, transaction will resolve to TOKEN_HAS_NO_FREEZE_KEY. - Key wipeKey = 8; // The new Wipe key of the Token. If the Token does not have currently a Wipe key, transaction will resolve to TOKEN_HAS_NO_WIPE_KEY. - Key supplyKey = 9; // The new Supply key of the Token. If the Token does not have currently a Supply key, transaction will resolve to TOKEN_HAS_NO_SUPPLY_KEY. - AccountID autoRenewAccount = 10; // The new account which will be automatically charged to renew the token's expiration, at autoRenewPeriod interval. - Duration autoRenewPeriod = 11; // The new interval at which the auto-renew account will be charged to extend the token's expiry. - Timestamp expiry = 12; // The new expiry time of the token. Expiry can be updated even if admin key is not set. If the provided expiry is earlier than the current token expiry, transaction wil resolve to INVALID_EXPIRATION_TIME - google.protobuf.StringValue memo = 13; // If set, the new memo to be associated with the token (UTF-8 encoding max 100 bytes) - repeated CustomTransferFeeInTokens customFeeInTokens = 14; // Custom fee in Token Units that needs to be paid to the specified receiver on a TokenTransfer - repeated CustomTransferFeeInHbar customFeeInHbar = 15;// Custom fee in hbar that needs to be paid to the specified receiver on a TokenTransfer -} diff --git a/services/TokenWipeAccount.proto b/services/TokenWipeAccount.proto deleted file mode 100644 index 7d7941f2..00000000 --- a/services/TokenWipeAccount.proto +++ /dev/null @@ -1,48 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; - -/* Wipes the provided amount of tokens from the specified Account. Must be signed by the Token's Wipe key. - If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID. - If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED. - If the provided token is not found, the transaction will resolve to INVALID_TOKEN_ID. - If the provided token has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. - If an Association between the provided token and account is not found, the transaction will resolve to TOKEN_NOT_ASSOCIATED_TO_ACCOUNT. - If Wipe Key is not present in the Token, transaction results in TOKEN_HAS_NO_WIPE_KEY. - If the provided account is the Token's Treasury Account, transaction results in CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT - On success, tokens are removed from the account and the total supply of the token is decreased by the wiped amount. - - The amount provided is in the lowest denomination possible. Example: - Token A has 2 decimals. In order to wipe 100 tokens from account, one must provide amount of 10000. In order to wipe 100.55 tokens, one must provide amount of 10055. - */ -message TokenWipeAccountTransactionBody { - TokenID token = 1; // The token for which the account will be wiped. If token does not exist, transaction results in INVALID_TOKEN_ID - AccountID account = 2; // The account to be wiped - uint64 amount = 3; // Applicable to tokens of type FUNGIBLE_COMMON. The amount of tokens to wipe from the specified account. Amount must be a positive non-zero number in the lowest denomination possible, not bigger than the token balance of the account (0; balance] - repeated int64 serialNumbers = 4; // Applicable to tokens of type NON_FUNGIBLE_UNIQUE. The list of serial numbers to be wiped. -} diff --git a/services/Transaction.proto b/services/Transaction.proto deleted file mode 100644 index 8ebaac27..00000000 --- a/services/Transaction.proto +++ /dev/null @@ -1,39 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - - -import "Duration.proto"; -import "BasicTypes.proto"; - -/* A single signed transaction, including all its signatures. The SignatureList will have a Signature for each Key in the transaction, either explicit or implicit, in the order that they appear in the transaction. For example, a CryptoTransfer will first have a Signature corresponding to the Key for the paying account, followed by a Signature corresponding to the Key for each account that is sending or receiving cryptocurrency in the transfer. Each Transaction should not have more than 50 levels. - * The SignatureList field is deprecated and succeeded by SignatureMap. - */ -message Transaction { - bytes signedTransactionBytes = 5; // SignedTransaction serialized into bytes - bytes bodyBytes = 4 [deprecated = true]; // TransactionBody serialized into bytes, which needs to be signed - SignatureMap sigMap = 3 [deprecated = true]; // The signatures on the body with the new format, to authorize the transaction -} diff --git a/services/TransactionBody.proto b/services/TransactionBody.proto deleted file mode 100644 index 43b2c288..00000000 --- a/services/TransactionBody.proto +++ /dev/null @@ -1,129 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "SystemDelete.proto"; -import "SystemUndelete.proto"; -import "Freeze.proto"; - -import "ContractCall.proto"; -import "ContractCreate.proto"; -import "ContractUpdate.proto"; - -import "CryptoAddLiveHash.proto"; -import "CryptoCreate.proto"; -import "CryptoDelete.proto"; -import "CryptoDeleteLiveHash.proto"; -import "CryptoTransfer.proto"; -import "CryptoUpdate.proto"; - -import "FileAppend.proto"; -import "FileCreate.proto"; -import "FileDelete.proto"; -import "FileUpdate.proto"; - -import "Duration.proto"; -import "BasicTypes.proto"; -import "ContractDelete.proto"; - -import "ConsensusCreateTopic.proto"; -import "ConsensusUpdateTopic.proto"; -import "ConsensusDeleteTopic.proto"; -import "ConsensusSubmitMessage.proto"; - -import "UncheckedSubmit.proto"; - -import "TokenCreate.proto"; -import "TokenFreezeAccount.proto"; -import "TokenUnfreezeAccount.proto"; -import "TokenGrantKyc.proto"; -import "TokenRevokeKyc.proto"; -import "TokenDelete.proto"; -import "TokenUpdate.proto"; -import "TokenMint.proto"; -import "TokenBurn.proto"; -import "TokenWipeAccount.proto"; -import "TokenAssociate.proto"; -import "TokenDissociate.proto"; - -import "ScheduleCreate.proto"; -import "ScheduleDelete.proto"; -import "ScheduleSign.proto"; - -/* A single transaction. All transaction types are possible here. */ -message TransactionBody { - TransactionID transactionID = 1; // The ID for this transaction, which includes the payer's account (the account paying the transaction fee). If two transactions have the same transactionID, they won't both have an effect - AccountID nodeAccountID = 2; // The account of the node that submits the client's transaction to the network - uint64 transactionFee = 3; // The maximum transaction fee the client is willing to pay - Duration transactionValidDuration = 4; //The transaction is invalid if consensusTimestamp > transactionID.transactionValidStart + transactionValidDuration - bool generateRecord = 5 [deprecated = true]; // Should a record of this transaction be generated? (A receipt is always generated, but the record is optional) - string memo = 6; // Any notes or descriptions that should be put into the record (max length 100) - oneof data { - ContractCallTransactionBody contractCall = 7; // Calls a function of a contract instance - ContractCreateTransactionBody contractCreateInstance = 8; // Creates a contract instance - ContractUpdateTransactionBody contractUpdateInstance = 9; // Updates a contract - ContractDeleteTransactionBody contractDeleteInstance = 22; //Delete contract and transfer remaining balance into specified account - - CryptoAddLiveHashTransactionBody cryptoAddLiveHash = 10; // Attach a new livehash to an account - CryptoCreateTransactionBody cryptoCreateAccount = 11; // Create a new cryptocurrency account - CryptoDeleteTransactionBody cryptoDelete = 12; // Delete a cryptocurrency account (mark as deleted, and transfer hbars out) - CryptoDeleteLiveHashTransactionBody cryptoDeleteLiveHash = 13; // Remove a livehash from an account - CryptoTransferTransactionBody cryptoTransfer = 14; // Transfer amount between accounts - CryptoUpdateTransactionBody cryptoUpdateAccount = 15; // Modify information such as the expiration date for an account - - FileAppendTransactionBody fileAppend = 16; // Add bytes to the end of the contents of a file - FileCreateTransactionBody fileCreate = 17; // Create a new file - FileDeleteTransactionBody fileDelete = 18; // Delete a file (remove contents and mark as deleted until it expires) - FileUpdateTransactionBody fileUpdate = 19; // Modify information such as the expiration date for a file - SystemDeleteTransactionBody systemDelete = 20; // Hedera administrative deletion of a file or smart contract - SystemUndeleteTransactionBody systemUndelete = 21; //To undelete an entity deleted by SystemDelete - FreezeTransactionBody freeze = 23; // Freeze the nodes - - ConsensusCreateTopicTransactionBody consensusCreateTopic = 24; // Creates a topic - ConsensusUpdateTopicTransactionBody consensusUpdateTopic = 25; // Updates a topic - ConsensusDeleteTopicTransactionBody consensusDeleteTopic = 26; // Deletes a topic - ConsensusSubmitMessageTransactionBody consensusSubmitMessage = 27; // Submits message to a topic - - UncheckedSubmitBody uncheckedSubmit = 28; - - TokenCreateTransactionBody tokenCreation = 29; // Creates a token instance - TokenFreezeAccountTransactionBody tokenFreeze = 31; // Freezes account not to be able to transact with a token - TokenUnfreezeAccountTransactionBody tokenUnfreeze = 32; // Unfreezes account for a token - TokenGrantKycTransactionBody tokenGrantKyc = 33; // Grants KYC to an account for a token - TokenRevokeKycTransactionBody tokenRevokeKyc = 34; // Revokes KYC of an account for a token - TokenDeleteTransactionBody tokenDeletion = 35; // Deletes a token instance - TokenUpdateTransactionBody tokenUpdate = 36; // Updates a token instance - TokenMintTransactionBody tokenMint = 37; // Mints new tokens to a token's treasury account - TokenBurnTransactionBody tokenBurn = 38; // Burns tokens from a token's treasury account - TokenWipeAccountTransactionBody tokenWipe = 39; // Wipes amount of tokens from an account - TokenAssociateTransactionBody tokenAssociate = 40; // Associate tokens to an account - TokenDissociateTransactionBody tokenDissociate = 41; // Dissociate tokens from an account - - ScheduleCreateTransactionBody scheduleCreate = 42; // Creates a schedule in the network's action queue - ScheduleDeleteTransactionBody scheduleDelete = 43; // Deletes a schedule from the network's action queue - ScheduleSignTransactionBody scheduleSign = 44; // Adds one or more Ed25519 keys to the affirmed signers of a scheduled transaction - } -} diff --git a/services/TransactionGetFastRecord.proto b/services/TransactionGetFastRecord.proto deleted file mode 100644 index 9a8fc100..00000000 --- a/services/TransactionGetFastRecord.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "TransactionRecord.proto"; -import "BasicTypes.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; - -/* Get the tx record of a transaction, given its transaction ID. Once a transaction reaches consensus, then information about whether it succeeded or failed will be available until the end of the receipt period. Before and after the receipt period, and for a transaction that was never submitted, the receipt is unknown. This query is free (the payment field is left empty). */ -message TransactionGetFastRecordQuery { - QueryHeader header = 1; // Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). - TransactionID transactionID = 2; // The ID of the transaction for which the record is requested. -} -/* Response when the client sends the node TransactionGetFastRecordQuery. If it created a new entity (account, file, or smart contract instance) then one of the three ID fields will be filled in with the ID of the new entity. Sometimes a single transaction will create more than one new entity, such as when a new contract instance is created, and this also creates the new account that it owned by that instance. */ -message TransactionGetFastRecordResponse { - ResponseHeader header = 1; //Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - TransactionRecord transactionRecord = 2; // The requested transaction records -} diff --git a/services/TransactionGetReceipt.proto b/services/TransactionGetReceipt.proto deleted file mode 100644 index 34240983..00000000 --- a/services/TransactionGetReceipt.proto +++ /dev/null @@ -1,44 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "TransactionReceipt.proto"; -import "BasicTypes.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; - -/* Get the receipt of a transaction, given its transaction ID. Once a transaction reaches consensus, then information about whether it succeeded or failed will be available until the end of the receipt period. Before and after the receipt period, and for a transaction that was never submitted, the receipt is unknown. This query is free (the payment field is left empty). No State proof is available for this response*/ -message TransactionGetReceiptQuery { - QueryHeader header = 1; // Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). - TransactionID transactionID = 2; // The ID of the transaction for which the receipt is requested. - bool includeDuplicates = 3; // Whether receipts of processing duplicate transactions should be returned along with the receipt of processing the first consensus transaction with the given id whose status was neither INVALID_NODE_ACCOUNT nor INVALID_PAYER_SIGNATURE; or, if no such receipt exists, the receipt of processing the first transaction to reach consensus with the given transaction id.. -} -/* Response when the client sends the node TransactionGetReceiptQuery. If it created a new entity (account, file, or smart contract instance) then one of the three ID fields will be filled in with the ID of the new entity. Sometimes a single transaction will create more than one new entity, such as when a new contract instance is created, and this also creates the new account that it owned by that instance. No State proof is available for this response */ -message TransactionGetReceiptResponse { - ResponseHeader header = 1; //Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - TransactionReceipt receipt = 2; // Either the receipt of processing the first consensus transaction with the given id whose status was neither INVALID_NODE_ACCOUNT nor INVALID_PAYER_SIGNATURE; or, if no such receipt exists, the receipt of processing the first transaction to reach consensus with the given transaction id. - repeated TransactionReceipt duplicateTransactionReceipts = 4; // The receipts of processing all consensus transaction with the same id as the distinguished receipt above, in chronological order. -} diff --git a/services/TransactionGetRecord.proto b/services/TransactionGetRecord.proto deleted file mode 100644 index 6019211a..00000000 --- a/services/TransactionGetRecord.proto +++ /dev/null @@ -1,46 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "TransactionRecord.proto"; -import "BasicTypes.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; - -/* Get the record for a transaction. If the transaction requested a record, then the record lasts for one hour, and a state proof is available for it. If the transaction created an account, file, or smart contract instance, then the record will contain the ID for what it created. If the transaction called a smart contract function, then the record contains the result of that call. If the transaction was a cryptocurrency transfer, then the record includes the TransferList which gives the details of that transfer. If the transaction didn't return anything that should be in the record, then the results field will be set to nothing. */ -message TransactionGetRecordQuery { - QueryHeader header = 1; // Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). - TransactionID transactionID = 2; // The ID of the transaction for which the record is requested. - bool includeDuplicates = 3; // Whether records of processing duplicate transactions should be returned along with the record of processing the first consensus transaction with the given id whose status was neither INVALID_NODE_ACCOUNT nor INVALID_PAYER_SIGNATURE; or, if no such record exists, the record of processing the first transaction to reach consensus with the given transaction id.. -} - -/* Response when the client sends the node TransactionGetRecordQuery */ -message TransactionGetRecordResponse { - ResponseHeader header = 1; // Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither. - TransactionRecord transactionRecord = 3; // Either the record of processing the first consensus transaction with the given id whose status was neither INVALID_NODE_ACCOUNT nor INVALID_PAYER_SIGNATURE; or, if no such record exists, the record of processing the first transaction to reach consensus with the given transaction id. - repeated TransactionRecord duplicateTransactionRecords = 4; // The records of processing all consensus transaction with the same id as the distinguished record above, in chronological order. -} - diff --git a/services/TransactionReceipt.proto b/services/TransactionReceipt.proto deleted file mode 100644 index ebee2ad3..00000000 --- a/services/TransactionReceipt.proto +++ /dev/null @@ -1,115 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "ResponseCode.proto"; -import "ExchangeRate.proto"; - -/* -The summary of a transaction's result so far. If the transaction has not reached consensus, this result will be necessarily incomplete. - */ -message TransactionReceipt { - // The consensus status of the transaction; is UNKNOWN if consensus has not been reached, or if the - // associated transaction did not have a valid payer signature - ResponseCodeEnum status = 1; - - // In the receipt of a CryptoCreate, the id of the newly created account - AccountID accountID = 2; - // In the receipt of a FileCreate, the id of the newly created file - FileID fileID = 3; - // In the receipt of a ContractCreate, the id of the newly created contract - ContractID contractID = 4; - // The exchange rates in effect when the transaction reached consensus - ExchangeRateSet exchangeRate = 5; - // In the receipt of a ConsensusCreateTopic, the id of the newly created topic. - TopicID topicID = 6; - - // In the receipt of a ConsensusSubmitMessage, the new sequence number of the topic that received the message - uint64 topicSequenceNumber = 7; - - // In the receipt of a ConsensusSubmitMessage, the new running hash of the topic that received the message. - // This 48-byte field is the output of a particular SHA-384 digest whose input data are determined by the - // value of the topicRunningHashVersion below. The bytes of each uint64 or uint32 are to be in Big-Endian - // format. - // - // IF the topicRunningHashVersion is '0' or '1', then the input data to the SHA-384 digest are, in order: - // --- - // 1. The previous running hash of the topic (48 bytes) - // 2. The topic's shard (8 bytes) - // 3. The topic's realm (8 bytes) - // 4. The topic's number (8 bytes) - // 5. The number of seconds since the epoch before the ConsensusSubmitMessage reached consensus (8 bytes) - // 6. The number of nanoseconds since 5. before the ConsensusSubmitMessage reached consensus (4 bytes) - // 7. The topicSequenceNumber from above (8 bytes) - // 8. The message bytes from the ConsensusSubmitMessage (variable). - // - // IF the topicRunningHashVersion is '2', then the input data to the SHA-384 digest are, in order: - // --- - // 1. The previous running hash of the topic (48 bytes) - // 2. The topicRunningHashVersion below (8 bytes) - // 3. The topic's shard (8 bytes) - // 4. The topic's realm (8 bytes) - // 5. The topic's number (8 bytes) - // 6. The number of seconds since the epoch before the ConsensusSubmitMessage reached consensus (8 bytes) - // 7. The number of nanoseconds since 6. before the ConsensusSubmitMessage reached consensus (4 bytes) - // 8. The topicSequenceNumber from above (8 bytes) - // 9. The output of the SHA-384 digest of the message bytes from the consensusSubmitMessage (48 bytes) - // - // Otherwise, IF the topicRunningHashVersion is '3', then the input data to the SHA-384 digest are, in order: - // --- - // 1. The previous running hash of the topic (48 bytes) - // 2. The topicRunningHashVersion below (8 bytes) - // 3. The payer account's shard (8 bytes) - // 4. The payer account's realm (8 bytes) - // 5. The payer account's number (8 bytes) - // 6. The topic's shard (8 bytes) - // 7. The topic's realm (8 bytes) - // 8. The topic's number (8 bytes) - // 9. The number of seconds since the epoch before the ConsensusSubmitMessage reached consensus (8 bytes) - // 10. The number of nanoseconds since 9. before the ConsensusSubmitMessage reached consensus (4 bytes) - // 11. The topicSequenceNumber from above (8 bytes) - // 12. The output of the SHA-384 digest of the message bytes from the consensusSubmitMessage (48 bytes) - bytes topicRunningHash = 8; - - // In the receipt of a ConsensusSubmitMessage, the version of the SHA-384 digest used to update the running hash. - uint64 topicRunningHashVersion = 9; - - // In the receipt of a CreateToken, the id of the newly created token - TokenID tokenID = 10; - - // In the receipt of TokenMint, TokenWipe, TokenBurn, the current total supply of this token - uint64 newTotalSupply = 11; - - // In the receipt of a ScheduleCreate, the id of the newly created Scheduled Entity - ScheduleID scheduleID = 12; - - // In the receipt of a ScheduleCreate or ScheduleSign that resolves to SUCCESS, the TransactionID that should be used to query for the receipt or record of the relevant scheduled transaction - TransactionID scheduledTransactionID = 13; - - // In the receipt of a TokenMint for tokens of type NON_FUNGIBLE_UNIQUE, the serial numbers of the newly created NFTs - repeated int64 serialNumbers = 14; -} diff --git a/services/TransactionRecord.proto b/services/TransactionRecord.proto deleted file mode 100644 index 5e19aeab..00000000 --- a/services/TransactionRecord.proto +++ /dev/null @@ -1,51 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hederahashgraph.api.proto.java"; -option java_multiple_files = true; - -import "Timestamp.proto"; -import "BasicTypes.proto"; -import "TransactionReceipt.proto"; -import "CryptoTransfer.proto"; -import "ContractCallLocal.proto"; - -/* Response when the client sends the node TransactionGetRecordResponse */ -message TransactionRecord { - TransactionReceipt receipt = 1; // The status (reach consensus, or failed, or is unknown) and the ID of any new account/file/instance created. - bytes transactionHash = 2; // The hash of the Transaction that executed (not the hash of any Transaction that failed for having a duplicate TransactionID) - Timestamp consensusTimestamp = 3; // The consensus timestamp (or null if didn't reach consensus yet) - TransactionID transactionID = 4; // The ID of the transaction this record represents - string memo = 5; // The memo that was submitted as part of the transaction (max 100 bytes) - uint64 transactionFee = 6; // The actual transaction fee charged, not the original transactionFee value from TransactionBody - oneof body { - ContractFunctionResult contractCallResult = 7; // Record of the value returned by the smart contract function (if it completed and didn't fail) from ContractCallTransaction - ContractFunctionResult contractCreateResult = 8; // Record of the value returned by the smart contract constructor (if it completed and didn't fail) from ContractCreateTransaction - } - TransferList transferList = 10; // All hbar transfers as a result of this transaction, such as fees, or transfers performed by the transaction, or by a smart contract it calls, or by the creation of threshold records that it triggers. - repeated TokenTransferList tokenTransferLists = 11; // All Token transfers as a result of this transaction - ScheduleID scheduleRef = 12; // Reference to the scheduled transaction ID that this transaction record represent - CustomHbarFees customHbarFees = 13; // All hbar transfers as a result of the CustomTransferFeeInHbar of a Token - tokenTransfer - CustomTokenUnitFees customTokenUnitFees = 14; // All Token transfers as a result of CustomTransferFeeInTokens of a Token - tokenTransfer -} diff --git a/services/basic_types.proto b/services/basic_types.proto new file mode 100644 index 00000000..6ea5e61f --- /dev/null +++ b/services/basic_types.proto @@ -0,0 +1,1468 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +import "timestamp.proto"; + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +/** + * Each shard has a nonnegative shard number. Each realm within a given shard has a nonnegative + * realm number (that number might be reused in other shards). And each account, file, and smart + * contract instance within a given realm has a nonnegative number (which might be reused in other + * realms). Every account, file, and smart contract instance is within exactly one realm. So a + * FileID is a triplet of numbers, like 0.1.2 for entity number 2 within realm 1 within shard 0. + * Each realm maintains a single counter for assigning numbers, so if there is a file with ID + * 0.1.2, then there won't be an account or smart contract instance with ID 0.1.2. + * + * Everything is partitioned into realms so that each Solidity smart contract can access everything + * in just a single realm, locking all those entities while it's running, but other smart contracts + * could potentially run in other realms in parallel. So realms allow Solidity to be parallelized + * somewhat, even though the language itself assumes everything is serial. + */ +message ShardID { + /** + * the shard number (nonnegative) + */ + int64 shardNum = 1; +} + +/** + * The ID for a realm. Within a given shard, every realm has a unique ID. Each account, file, and + * contract instance belongs to exactly one realm. + */ +message RealmID { + /** + * The shard number (nonnegative) + */ + int64 shardNum = 1; + + /** + * The realm number (nonnegative) + */ + int64 realmNum = 2; +} + +/** + * The ID for an a cryptocurrency account + */ +message AccountID { + /** + * The shard number (nonnegative) + */ + int64 shardNum = 1; + + /** + * The realm number (nonnegative) + */ + int64 realmNum = 2; + + /** + * The account number unique within its realm which can be either a non-negative integer or an alias public key. + * For any AccountID fields in the query response, transaction record or transaction receipt only accountNum will + * be populated. + */ + oneof account { + + /** + * A non-negative account number unique within its realm + */ + int64 accountNum = 3; + + /** + * The public key bytes to be used as the account's alias. The public key bytes are the result of serializing + * a protobuf Key message for any primitive key type. Currently only primitive key bytes are supported as an alias + * (ThresholdKey, KeyList, ContractID, and delegatable_contract_id are not supported) + * + * At most one account can ever have a given alias and it is used for account creation if it + * was automatically created using a crypto transfer. It will be null if an account is created normally. + * It is immutable once it is set for an account. + * + * If a transaction auto-creates the account, any further transfers to that alias will simply be deposited + * in that account, without creating anything, and with no creation fee being charged. + */ + bytes alias = 4; + } + +} + +/** + * The ID for a file + */ +message FileID { + /** + * The shard number (nonnegative) + */ + int64 shardNum = 1; + + /** + * The realm number (nonnegative) + */ + int64 realmNum = 2; + + /** + * A nonnegative File number unique within its realm + */ + int64 fileNum = 3; +} + +/** + * The ID for a smart contract instance + */ +message ContractID { + /** + * The shard number (nonnegative) + */ + int64 shardNum = 1; + + /** + * The realm number (nonnegative) + */ + int64 realmNum = 2; + + /** + * A nonnegative number unique within its realm + */ + int64 contractNum = 3; +} + +/** + * The ID for a transaction. This is used for retrieving receipts and records for a transaction, for + * appending to a file right after creating it, for instantiating a smart contract with bytecode in + * a file just created, and internally by the network for detecting when duplicate transactions are + * submitted. A user might get a transaction processed faster by submitting it to N nodes, each with + * a different node account, but all with the same TransactionID. Then, the transaction will take + * effect when the first of all those nodes submits the transaction and it reaches consensus. The + * other transactions will not take effect. So this could make the transaction take effect faster, + * if any given node might be slow. However, the full transaction fee is charged for each + * transaction, so the total fee is N times as much if the transaction is sent to N nodes. + * + * Applicable to Scheduled Transactions: + * - The ID of a Scheduled Transaction has transactionValidStart and accountIDs inherited from the + * ScheduleCreate transaction that created it. That is to say that they are equal + * - The scheduled property is true for Scheduled Transactions + * - transactionValidStart, accountID and scheduled properties should be omitted + */ +message TransactionID { + /** + * The transaction is invalid if consensusTimestamp < transactionID.transactionStartValid + */ + Timestamp transactionValidStart = 1; + + /** + * The Account ID that paid for this transaction + */ + AccountID accountID = 2; + + /** + * Whether the Transaction is of type Scheduled or no + */ + bool scheduled = 3; + + /** + * The identifier for an internal transaction that was spawned as part + * of handling a user transaction. (These internal transactions share the + * transactionValidStart and accountID of the user transaction, so a + * nonce is necessary to give them a unique TransactionID.) + * + * An example is when a "parent" ContractCreate or ContractCall transaction + * calls one or more HTS precompiled contracts; each of the "child" + * transactions spawned for a precompile has a id with a different nonce. + */ + int32 nonce = 4; +} + +/** + * An account, and the amount that it sends or receives during a cryptocurrency or token transfer. + */ +message AccountAmount { + /** + * The Account ID that sends/receives cryptocurrency or tokens + */ + AccountID accountID = 1; + + /** + * The amount of tinybars (for Crypto transfers) or in the lowest + * denomination (for Token transfers) that the account sends(negative) or + * receives(positive) + */ + sint64 amount = 2; +} + +/** + * A list of accounts and amounts to transfer out of each account (negative) or into it (positive). + */ +message TransferList { + /** + * Multiple list of AccountAmount pairs, each of which has an account and + * an amount to transfer into it (positive) or out of it (negative) + */ + repeated AccountAmount accountAmounts = 1; +} + +/** + * A sender account, a receiver account, and the serial number of an NFT of a Token with + * NON_FUNGIBLE_UNIQUE type. When minting NFTs the sender will be the default AccountID instance + * (0.0.0) and when burning NFTs, the receiver will be the default AccountID instance. + */ +message NftTransfer { + /** + * The accountID of the sender + */ + AccountID senderAccountID = 1; + + /** + * The accountID of the receiver + */ + AccountID receiverAccountID = 2; + + /** + * The serial number of the NFT + */ + int64 serialNumber = 3; +} + +/** + * A list of token IDs and amounts representing the transferred out (negative) or into (positive) + * amounts, represented in the lowest denomination of the token + */ +message TokenTransferList { + /** + * The ID of the token + */ + TokenID token = 1; + + /** + * Applicable to tokens of type FUNGIBLE_COMMON. Multiple list of AccountAmounts, each of which + * has an account and amount + */ + repeated AccountAmount transfers = 2; + + /** + * Applicable to tokens of type NON_FUNGIBLE_UNIQUE. Multiple list of NftTransfers, each of + * which has a sender and receiver account, including the serial number of the NFT + */ + repeated NftTransfer nftTransfers = 3; +} + +/** + * A rational number, used to set the amount of a value transfer to collect as a custom fee + */ +message Fraction { + /** + * The rational's numerator + */ + int64 numerator = 1; + + /** + * The rational's denominator; a zero value will result in FRACTION_DIVIDES_BY_ZERO + */ + int64 denominator = 2; +} + +/** + * Unique identifier for a topic (used by the consensus service) + */ +message TopicID { + /** + * The shard number (nonnegative) + */ + int64 shardNum = 1; + + /** + * The realm number (nonnegative) + */ + int64 realmNum = 2; + + /** + * Unique topic identifier within a realm (nonnegative). + */ + int64 topicNum = 3; +} + +/** + * Unique identifier for a token + */ +message TokenID { + /** + * A nonnegative shard number + */ + int64 shardNum = 1; + + /** + * A nonnegative realm number + */ + int64 realmNum = 2; + + /** + * A nonnegative token number + */ + int64 tokenNum = 3; +} + +/** + * Unique identifier for a Schedule + */ +message ScheduleID { + /** + * A nonnegative shard number + */ + int64 shardNum = 1; + + /** + * A nonnegative realm number + */ + int64 realmNum = 2; + + /** + * A nonnegative schedule number + */ + int64 scheduleNum = 3; +} + +/** + * Possible Token Types (IWA Compatibility). + * Apart from fungible and non-fungible, Tokens can have either a common or unique representation. + * This distinction might seem subtle, but it is important when considering how tokens can be traced + * and if they can have isolated and unique properties. + */ +enum TokenType { + /** + * Interchangeable value with one another, where any quantity of them has the same value as + * another equal quantity if they are in the same class. Share a single set of properties, not + * distinct from one another. Simply represented as a balance or quantity to a given Hedera + * account. + */ + FUNGIBLE_COMMON = 0; + + /** + * Unique, not interchangeable with other tokens of the same type as they typically have + * different values. Individually traced and can carry unique properties (e.g. serial number). + */ + NON_FUNGIBLE_UNIQUE = 1; +} + +/** + * Allows a set of resource prices to be scoped to a certain type of a HAPI operation. + * + * For example, the resource prices for a TokenMint operation are different between minting fungible + * and non-fungible tokens. This enum allows us to "mark" a set of prices as applying to one or the + * other. + * + * Similarly, the resource prices for a basic TokenCreate without a custom fee schedule yield a + * total price of $1. The resource prices for a TokenCreate with a custom fee schedule are different + * and yield a total base price of $2. + */ +enum SubType { + /** + * The resource prices have no special scope + */ + DEFAULT = 0; + + /** + * The resource prices are scoped to an operation on a fungible common token + */ + TOKEN_FUNGIBLE_COMMON = 1; + + /** + * The resource prices are scoped to an operation on a non-fungible unique token + */ + TOKEN_NON_FUNGIBLE_UNIQUE = 2; + + /** + * The resource prices are scoped to an operation on a fungible common + * token with a custom fee schedule + */ + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3; + + /** + * The resource prices are scoped to an operation on a non-fungible unique + * token with a custom fee schedule + */ + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4; +} + +/** + * Possible Token Supply Types (IWA Compatibility). + * Indicates how many tokens can have during its lifetime. + */ +enum TokenSupplyType { + /** + * Indicates that tokens of that type have an upper bound of Long.MAX_VALUE. + */ + INFINITE = 0; + + /** + * Indicates that tokens of that type have an upper bound of maxSupply, + * provided on token creation. + */ + FINITE = 1; +} + +/** + * Possible Freeze statuses returned on TokenGetInfoQuery or CryptoGetInfoResponse in + * TokenRelationship + */ +enum TokenFreezeStatus { + /** + * UNDOCUMENTED + */ + FreezeNotApplicable = 0; + + /** + * UNDOCUMENTED + */ + Frozen = 1; + + /** + * UNDOCUMENTED + */ + Unfrozen = 2; +} + +/** + * Possible KYC statuses returned on TokenGetInfoQuery or CryptoGetInfoResponse in TokenRelationship + */ +enum TokenKycStatus { + /** + * UNDOCUMENTED + */ + KycNotApplicable = 0; + + /** + * UNDOCUMENTED + */ + Granted = 1; + + /** + * UNDOCUMENTED + */ + Revoked = 2; +} + +/** + * Possible Pause statuses returned on TokenGetInfoQuery + */ +enum TokenPauseStatus { + /** + * Indicates that a Token has no pauseKey + */ + PauseNotApplicable = 0; + + /** + * Indicates that a Token is Paused + */ + Paused = 1; + + /** + * Indicates that a Token is Unpaused. + */ + Unpaused = 2; +} + +/** + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) signature schemes, where + * in the ECDSA(secp256k1) case we require the 33-byte compressed form of the public key. We call + * these public keys primitive keys. + * + * If an account has primitive key associated to it, then the corresponding private key must sign + * any transaction to transfer cryptocurrency out of it. + * + * A Key can also be the ID of a smart contract instance, which is then authorized to perform any + * precompiled contract action that requires this key to sign. + * + * Note that when a Key is a smart contract ID, it doesn't mean the contract with that ID + * will actually create a cryptographic signature. It only means that when the contract calls a + * precompiled contract, the resulting "child transaction" will be authorized to perform any action + * controlled by the Key. + * + * A Key can be a "threshold key", which means a list of M keys, any N of which must sign in order + * for the threshold signature to be considered valid. The keys within a threshold signature may + * themselves be threshold signatures, to allow complex signature requirements. + * + * A Key can be a "key list" where all keys in the list must sign unless specified otherwise in the + * documentation for a specific transaction type (e.g. FileDeleteTransactionBody). Their use is + * dependent on context. For example, a Hedera file is created with a list of keys, where all of + * them must sign a transaction to create or modify the file, but only one of them is needed to sign + * a transaction to delete the file. So it's a single list that sometimes acts as a 1-of-M threshold + * key, and sometimes acts as an M-of-M threshold key. A key list is always an M-of-M, unless + * specified otherwise in documentation. A key list can have nested key lists or threshold keys. + * Nested key lists are always M-of-M. A key list can have repeated primitive public keys, but all + * repeated keys are only required to sign once. + * + * A Key can contain a ThresholdKey or KeyList, which in turn contain a Key, so this mutual + * recursion would allow nesting arbitrarily deep. A ThresholdKey which contains a list of primitive + * keys has 3 levels: ThresholdKey -> KeyList -> Key. A KeyList which contains several primitive + * keys has 2 levels: KeyList -> Key. A Key with 2 levels of nested ThresholdKeys has 7 levels: + * Key -> ThresholdKey -> KeyList -> Key -> ThresholdKey -> KeyList -> Key. + * + * Each Key should not have more than 46 levels, which implies 15 levels of nested ThresholdKeys. + */ +message Key { + oneof key { + /** + * smart contract instance that is authorized as if it had signed with a key + */ + ContractID contractID = 1; + + /** + * Ed25519 public key bytes + */ + bytes ed25519 = 2; + + /** + * (NOT SUPPORTED) RSA-3072 public key bytes + */ + bytes RSA_3072 = 3; + + /** + * (NOT SUPPORTED) ECDSA with the p-384 curve public key bytes + */ + bytes ECDSA_384 = 4; + + /** + * a threshold N followed by a list of M keys, any N of which are required to form a valid + * signature + */ + ThresholdKey thresholdKey = 5; + + /** + * A list of Keys of the Key type. + */ + KeyList keyList = 6; + + /** + * Compressed ECDSA(secp256k1) public key bytes + */ + bytes ECDSA_secp256k1 = 7; + + /** + * A smart contract that, if the recipient of the active message frame, should be treated + * as having signed. (Note this does not mean the code being executed in the frame + * will belong to the given contract, since it could be running another contract's code via + * delegatecall. So setting this key is a more permissive version of setting the + * contractID key, which also requires the code in the active message frame belong to the + * the contract with the given id.) + */ + ContractID delegatable_contract_id = 8; + } +} + +/** + * A set of public keys that are used together to form a threshold signature. If the threshold is N + * and there are M keys, then this is an N of M threshold signature. If an account is associated + * with ThresholdKeys, then a transaction to move cryptocurrency out of it must be signed by a list + * of M signatures, where at most M-N of them are blank, and the other at least N of them are valid + * signatures corresponding to at least N of the public keys listed here. + */ +message ThresholdKey { + /** + * A valid signature set must have at least this many signatures + */ + uint32 threshold = 1; + + /** + * List of all the keys that can sign + */ + KeyList keys = 2; +} + +/** + * A list of keys that requires all keys (M-of-M) to sign unless otherwise specified in + * documentation. A KeyList may contain repeated keys, but all repeated keys are only required to + * sign once. + */ +message KeyList { + /** + * list of keys + */ + repeated Key keys = 1; +} + +/** + * This message is DEPRECATED and UNUSABLE with network nodes. It is retained + * here only for historical reasons. + * + * Please use the SignaturePair and SignatureMap messages. + */ +message Signature { + option deprecated = true; + + oneof signature { + /** + * smart contract virtual signature (always length zero) + */ + bytes contract = 1; + + /** + * ed25519 signature bytes + */ + bytes ed25519 = 2; + + /** + * RSA-3072 signature bytes + */ + bytes RSA_3072 = 3; + + /** + * ECDSA p-384 signature bytes + */ + bytes ECDSA_384 = 4; + + /** + * A list of signatures for a single N-of-M threshold Key. This must be a list of exactly M + * signatures, at least N of which are non-null. + */ + ThresholdSignature thresholdSignature = 5; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList of the same length. + */ + SignatureList signatureList = 6; + } +} + +/** + * This message is DEPRECATED and UNUSABLE with network nodes. It is retained + * here only for historical reasons. + * + * Please use the SignaturePair and SignatureMap messages. + */ +message ThresholdSignature { + option deprecated = true; + + /** + * for an N-of-M threshold key, this is a list of M signatures, at least N of which must be + * non-null + */ + SignatureList sigs = 2; +} + +/** + * This message is DEPRECATED and UNUSABLE with network nodes. It is retained + * here only for historical reasons. + * + * Please use the SignaturePair and SignatureMap messages. + */ +message SignatureList { + option deprecated = true; + + /** + * each signature corresponds to a Key in the KeyList + */ + repeated Signature sigs = 2; +} + +/** + * The client may use any number of bytes from zero to the whole length of the public key for + * pubKeyPrefix. If zero bytes are used, then it must be that only one primitive key is required + * to sign the linked transaction; it will surely resolve to INVALID_SIGNATURE otherwise. + * + * IMPORTANT: In the special case that a signature is being provided for a key used to + * authorize a precompiled contract, the pubKeyPrefix must contain the entire public + * key! That is, if the key is a Ed25519 key, the pubKeyPrefix should be 32 bytes + * long. If the key is a ECDSA(secp256k1) key, the pubKeyPrefix should be 33 bytes long, + * since we require the compressed form of the public key. + * + * Only Ed25519 and ECDSA(secp256k1) keys and hence signatures are currently supported. + */ +message SignaturePair { + /** + * First few bytes of the public key + */ + bytes pubKeyPrefix = 1; + + oneof signature { + /** + * smart contract virtual signature (always length zero) + */ + bytes contract = 2; + + /** + * ed25519 signature + */ + bytes ed25519 = 3; + + /** + * RSA-3072 signature + */ + bytes RSA_3072 = 4; + + /** + * ECDSA p-384 signature + */ + bytes ECDSA_384 = 5; + + /** + * ECDSA(secp256k1) signature + */ + bytes ECDSA_secp256k1 = 6; + } +} + +/** + * A set of signatures corresponding to every unique public key used to sign a given transaction. If + * one public key matches more than one prefixes on the signature map, the transaction containing + * the map will fail immediately with the response code KEY_PREFIX_MISMATCH. + */ +message SignatureMap { + /** + * Each signature pair corresponds to a unique Key required to sign the transaction. + */ + repeated SignaturePair sigPair = 1; +} + +/** + * The transactions and queries supported by Hedera Hashgraph. + */ +enum HederaFunctionality { + /** + * UNSPECIFIED - Need to keep first value as unspecified because first element is ignored and + * not parsed (0 is ignored by parser) + */ + NONE = 0; + + /** + * crypto transfer + */ + CryptoTransfer = 1; + + /** + * crypto update account + */ + CryptoUpdate = 2; + + /** + * crypto delete account + */ + CryptoDelete = 3; + + /** + * Add a livehash to a crypto account + */ + CryptoAddLiveHash = 4; + + /** + * Delete a livehash from a crypto account + */ + CryptoDeleteLiveHash = 5; + + /** + * Smart Contract Call + */ + ContractCall = 6; + + /** + * Smart Contract Create Contract + */ + ContractCreate = 7; + + /** + * Smart Contract update contract + */ + ContractUpdate = 8; + + /** + * File Operation create file + */ + FileCreate = 9; + + /** + * File Operation append file + */ + FileAppend = 10; + + /** + * File Operation update file + */ + FileUpdate = 11; + + /** + * File Operation delete file + */ + FileDelete = 12; + + /** + * crypto get account balance + */ + CryptoGetAccountBalance = 13; + + /** + * crypto get account record + */ + CryptoGetAccountRecords = 14; + + /** + * Crypto get info + */ + CryptoGetInfo = 15; + + /** + * Smart Contract Call + */ + ContractCallLocal = 16; + + /** + * Smart Contract get info + */ + ContractGetInfo = 17; + + /** + * Smart Contract, get the byte code + */ + ContractGetBytecode = 18; + + /** + * Smart Contract, get by solidity ID + */ + GetBySolidityID = 19; + + /** + * Smart Contract, get by key + */ + GetByKey = 20; + + /** + * Get a live hash from a crypto account + */ + CryptoGetLiveHash = 21; + + /** + * Crypto, get the stakers for the node + */ + CryptoGetStakers = 22; + + /** + * File Operations get file contents + */ + FileGetContents = 23; + + /** + * File Operations get the info of the file + */ + FileGetInfo = 24; + + /** + * Crypto get the transaction records + */ + TransactionGetRecord = 25; + + /** + * Contract get the transaction records + */ + ContractGetRecords = 26; + + /** + * crypto create account + */ + CryptoCreate = 27; + + /** + * system delete file + */ + SystemDelete = 28; + + /** + * system undelete file + */ + SystemUndelete = 29; + + /** + * delete contract + */ + ContractDelete = 30; + + /** + * freeze + */ + Freeze = 31; + + /** + * Create Tx Record + */ + CreateTransactionRecord = 32; + + /** + * Crypto Auto Renew + */ + CryptoAccountAutoRenew = 33; + + /** + * Contract Auto Renew + */ + ContractAutoRenew = 34; + + /** + * Get Version + */ + GetVersionInfo = 35; + + /** + * Transaction Get Receipt + */ + TransactionGetReceipt = 36; + + /** + * Create Topic + */ + ConsensusCreateTopic = 50; + + /** + * Update Topic + */ + ConsensusUpdateTopic = 51; + + /** + * Delete Topic + */ + ConsensusDeleteTopic = 52; + + /** + * Get Topic information + */ + ConsensusGetTopicInfo = 53; + + /** + * Submit message to topic + */ + ConsensusSubmitMessage = 54; + + UncheckedSubmit = 55; + /** + * Create Token + */ + TokenCreate = 56; + + /** + * Get Token information + */ + TokenGetInfo = 58; + + /** + * Freeze Account + */ + TokenFreezeAccount = 59; + + /** + * Unfreeze Account + */ + TokenUnfreezeAccount = 60; + + /** + * Grant KYC to Account + */ + TokenGrantKycToAccount = 61; + + /** + * Revoke KYC from Account + */ + TokenRevokeKycFromAccount = 62; + + /** + * Delete Token + */ + TokenDelete = 63; + + /** + * Update Token + */ + TokenUpdate = 64; + + /** + * Mint tokens to treasury + */ + TokenMint = 65; + + /** + * Burn tokens from treasury + */ + TokenBurn = 66; + + /** + * Wipe token amount from Account holder + */ + TokenAccountWipe = 67; + + /** + * Associate tokens to an account + */ + TokenAssociateToAccount = 68; + + /** + * Dissociate tokens from an account + */ + TokenDissociateFromAccount = 69; + + /** + * Create Scheduled Transaction + */ + ScheduleCreate = 70; + + /** + * Delete Scheduled Transaction + */ + ScheduleDelete = 71; + + /** + * Sign Scheduled Transaction + */ + ScheduleSign = 72; + + /** + * Get Scheduled Transaction Information + */ + ScheduleGetInfo = 73; + + /** + * Get Token Account Nft Information + */ + TokenGetAccountNftInfos = 74; + + /** + * Get Token Nft Information + */ + TokenGetNftInfo = 75; + + /** + * Get Token Nft List Information + */ + TokenGetNftInfos = 76; + + /** + * Update a token's custom fee schedule, if permissible + */ + TokenFeeScheduleUpdate = 77; + + /** + * Get execution time(s) by TransactionID, if available + */ + NetworkGetExecutionTime = 78; + + /** + * Pause the Token + */ + TokenPause = 79; + + /** + * Unpause the Token + */ + TokenUnpause = 80; +} + +/** + * A set of prices the nodes use in determining transaction and query fees, and constants involved + * in fee calculations. Nodes multiply the amount of resources consumed by a transaction or query + * by the corresponding price to calculate the appropriate fee. Units are one-thousandth of a + * tinyCent. + */ +message FeeComponents { + /** + * A minimum, the calculated fee must be greater than this value + */ + int64 min = 1; + + /** + * A maximum, the calculated fee must be less than this value + */ + int64 max = 2; + + /** + * A constant contribution to the fee + */ + int64 constant = 3; + + /** + * The price of bandwidth consumed by a transaction, measured in bytes + */ + int64 bpt = 4; + + /** + * The price per signature verification for a transaction + */ + int64 vpt = 5; + + /** + * The price of RAM consumed by a transaction, measured in byte-hours + */ + int64 rbh = 6; + + /** + * The price of storage consumed by a transaction, measured in byte-hours + */ + int64 sbh = 7; + + /** + * The price of computation for a smart contract transaction, measured in gas + */ + int64 gas = 8; + + /** + * The price per hbar transferred for a transfer + */ + int64 tv = 9; + + /** + * The price of bandwidth for data retrieved from memory for a response, measured in bytes + */ + int64 bpr = 10; + + /** + * The price of bandwidth for data retrieved from disk for a response, measured in bytes + */ + int64 sbpr = 11; +} + +/** + * The fees for a specific transaction or query based on the fee data. + */ +message TransactionFeeSchedule { + /** + * A particular transaction or query + */ + HederaFunctionality hederaFunctionality = 1; + + /** + * Resource price coefficients + */ + FeeData feeData = 2 [deprecated=true]; + + /** + * Resource price coefficients. Supports subtype price definition. + */ + repeated FeeData fees = 3; +} + +/** + * The total fee charged for a transaction. It is composed of three components – a node fee that + * compensates the specific node that submitted the transaction, a network fee that compensates the + * network for assigning the transaction a consensus timestamp, and a service fee that compensates + * the network for the ongoing maintenance of the consequences of the transaction. + */ +message FeeData { + /** + * Fee paid to the submitting node + */ + FeeComponents nodedata = 1; + + /** + * Fee paid to the network for processing a transaction into consensus + */ + FeeComponents networkdata = 2; + + /** + * Fee paid to the network for providing the service associated with the + * transaction; for instance, storing a file + */ + FeeComponents servicedata = 3; + + /** + * SubType distinguishing between different types of FeeData, correlating + * to the same HederaFunctionality + */ + SubType subType = 4; +} + +/** + * A list of resource prices fee for different transactions and queries and the time period at which + * this fee schedule will expire. Nodes use the prices to determine the fees for all transactions + * based on how much of those resources each transaction uses. + */ +message FeeSchedule { + /** + * List of price coefficients for network resources + */ + repeated TransactionFeeSchedule transactionFeeSchedule = 1; + + /** + * FeeSchedule expiry time + */ + TimestampSeconds expiryTime = 2; +} + +/** + * This contains two Fee Schedules with expiry timestamp. + */ +message CurrentAndNextFeeSchedule { + /** + * Contains current Fee Schedule + */ + FeeSchedule currentFeeSchedule = 1; + + /** + * Contains next Fee Schedule + */ + FeeSchedule nextFeeSchedule = 2; +} + +/** + * Contains the IP address and the port representing a service endpoint of a Node in a network. Used + * to reach the Hedera API and submit transactions to the network. + */ +message ServiceEndpoint { + /** + * The 32-bit IPv4 address of the node encoded in left to right order (e.g. 127.0.0.1 has 127 + * as its first byte) + */ + bytes ipAddressV4 = 1; + + /** + * The port of the node + */ + int32 port = 2; +} + +/** + * The data about a node, including its service endpoints and the Hedera account to be paid for + * services provided by the node (that is, queries answered and transactions submitted.) + * + * If the serviceEndpoint list is not set, or empty, then the endpoint given by the + * (deprecated) ipAddress and portno fields should be used. + * + * All fields are populated in the 0.0.102 address book file while only fields that start with # are + * populated in the 0.0.101 address book file. + */ +message NodeAddress { + /** + * The IP address of the Node with separator & octets encoded in UTF-8. Usage is deprecated, + * ServiceEndpoint is preferred to retrieve a node's list of IP addresses and ports + */ + bytes ipAddress = 1 [deprecated=true]; + + /** + * The port number of the grpc server for the node. Usage is deprecated, ServiceEndpoint is + * preferred to retrieve a node's list of IP addresses and ports + */ + int32 portno = 2 [deprecated=true]; + + /** + * Usage is deprecated, nodeAccountId is preferred to retrieve a node's account ID + */ + bytes memo = 3 [deprecated=true]; + + /** + * The node's X509 RSA public key used to sign stream files (e.g., record stream + * files). Precisely, this field is a string of hexadecimal characters which, + * translated to binary, are the public key's DER encoding. + */ + string RSA_PubKey = 4; + + /** + * # A non-sequential identifier for the node + */ + int64 nodeId = 5; + + /** + * # The account to be paid for queries and transactions sent to this node + */ + AccountID nodeAccountId = 6; + + /** + * # Hash of the node's TLS certificate. Precisely, this field is a string of + * hexadecimal characters which, translated to binary, are the SHA-384 hash of + * the UTF-8 NFKD encoding of the node's TLS cert in PEM format. Its value can be + * used to verify the node's certificate it presents during TLS negotiations. + */ + bytes nodeCertHash = 7; + + /** + * # A node's service IP addresses and ports + */ + repeated ServiceEndpoint serviceEndpoint = 8; + + /** + * A description of the node, with UTF-8 encoding up to 100 bytes + */ + string description = 9; + + /** + * The amount of tinybars staked to the node + */ + int64 stake = 10; +} + +/** + * A list of nodes and their metadata that contains all details of the nodes for the network. Used + * to parse the contents of system files 0.0.101 and 0.0.102. + */ +message NodeAddressBook { + /** + * Metadata of all nodes in the network + */ + repeated NodeAddress nodeAddress = 1; +} + +/** + * Hedera follows semantic versioning (https://semver.org/) for both the HAPI protobufs and the + * Services software. This type allows the getVersionInfo query in the + * NetworkService to return the deployed versions of both protobufs and software on the + * node answering the query. + */ +message SemanticVersion { + /** + * Increases with incompatible API changes + */ + int32 major = 1; + + /** + * Increases with backwards-compatible new functionality + */ + int32 minor = 2; + + /** + * Increases with backwards-compatible bug fixes + */ + int32 patch = 3; + + /** + * A pre-release version MAY be denoted by appending a hyphen and a series of dot separated + * identifiers (https://semver.org/#spec-item-9); so given a semver 0.14.0-alpha.1+21AF26D3, + * this field would contain 'alpha.1' + */ + string pre = 4; + + /** + * Build metadata MAY be denoted by appending a plus sign and a series of dot separated + * identifiers immediately following the patch or pre-release version + * (https://semver.org/#spec-item-10); so given a semver 0.14.0-alpha.1+21AF26D3, this field + * would contain '21AF26D3' + */ + string build = 5; +} + +/** + * UNDOCUMENTED + */ +message Setting { + /** + * name of the property + */ + string name = 1; + + /** + * value of the property + */ + string value = 2; + + /** + * any data associated with property + */ + bytes data = 3; +} + +/** + * UNDOCUMENTED + */ +message ServicesConfigurationList { + /** + * list of name value pairs of the application properties + */ + repeated Setting nameValue = 1; +} + +/** + * Token's information related to the given Account + */ +message TokenRelationship { + /** + * The ID of the token + */ + TokenID tokenId = 1; + + /** + * The Symbol of the token + */ + string symbol = 2; + + /** + * For token of type FUNGIBLE_COMMON - the balance that the Account holds in the smallest + * denomination. For token of type NON_FUNGIBLE_UNIQUE - the number of NFTs held by the account + */ + uint64 balance = 3; + + /** + * The KYC status of the account (KycNotApplicable, Granted or Revoked). If the token does not + * have KYC key, KycNotApplicable is returned + */ + TokenKycStatus kycStatus = 4; + + /** + * The Freeze status of the account (FreezeNotApplicable, Frozen or Unfrozen). If the token does + * not have Freeze key, FreezeNotApplicable is returned + */ + TokenFreezeStatus freezeStatus = 5; + + /** + * Tokens divide into 10decimals pieces + */ + uint32 decimals = 6; + + /** + * Specifies if the relationship is created implicitly. False : explicitly associated, True : + * implicitly associated. + */ + bool automatic_association = 7; +} + +/** + * A number of transferable units of a certain token. + * + * The transferable unit of a token is its smallest denomination, as given by the token's + * decimals property---each minted token contains 10decimals + * transferable units. For example, we could think of the cent as the transferable unit of the US + * dollar (decimals=2); and the tinybar as the transferable unit of hbar + * (decimals=8). + * + * Transferable units are not directly comparable across different tokens. + */ +message TokenBalance { + /** + * A unique token id + */ + TokenID tokenId = 1; + + /** + * Number of transferable units of the identified token. For token of type FUNGIBLE_COMMON - + * balance in the smallest denomination. For token of type NON_FUNGIBLE_UNIQUE - the number of + * NFTs held by the account + */ + uint64 balance = 2; + + /** + * Tokens divide into 10decimals pieces + */ + uint32 decimals = 3; +} + +/** + * A sequence of token balances + */ +message TokenBalances { + repeated TokenBalance tokenBalances = 1; +} + +/* A token - account association */ +message TokenAssociation { + TokenID token_id = 1; // The token involved in the association + AccountID account_id = 2; // The account involved in the association +} diff --git a/services/ConsensusCreateTopic.proto b/services/consensus_create_topic.proto similarity index 55% rename from services/ConsensusCreateTopic.proto rename to services/consensus_create_topic.proto index 23cba5b9..e33861d8 100644 --- a/services/ConsensusCreateTopic.proto +++ b/services/consensus_create_topic.proto @@ -25,35 +25,48 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "BasicTypes.proto"; -import "Duration.proto"; +import "basic_types.proto"; +import "duration.proto"; -// See [ConsensusService.createTopic()](#proto.ConsensusService) +/** + * See [ConsensusService.createTopic()](#proto.ConsensusService) + */ message ConsensusCreateTopicTransactionBody { - string memo = 1; // Short publicly visible memo about the topic. No guarantee of uniqueness. + /** + * Short publicly visible memo about the topic. No guarantee of uniqueness. + */ + string memo = 1; - // Access control for updateTopic/deleteTopic. - // Anyone can increase the topic's expirationTime via ConsensusService.updateTopic(), regardless of the adminKey. - // If no adminKey is specified, updateTopic may only be used to extend the topic's expirationTime, and deleteTopic - // is disallowed. + /** + * Access control for updateTopic/deleteTopic. + * Anyone can increase the topic's expirationTime via ConsensusService.updateTopic(), regardless of the adminKey. + * If no adminKey is specified, updateTopic may only be used to extend the topic's expirationTime, and deleteTopic + * is disallowed. + */ Key adminKey = 2; - // Access control for submitMessage. - // If unspecified, no access control is performed on ConsensusService.submitMessage (all submissions are allowed). + /** + * Access control for submitMessage. + * If unspecified, no access control is performed on ConsensusService.submitMessage (all submissions are allowed). + */ Key submitKey = 3; - // The initial lifetime of the topic and the amount of time to attempt to extend the topic's lifetime by - // automatically at the topic's expirationTime, if the autoRenewAccount is configured (once autoRenew functionality - // is supported by HAPI). - // Limited to MIN_AUTORENEW_PERIOD and MAX_AUTORENEW_PERIOD value by server-side configuration. - // Required. + /** + * The initial lifetime of the topic and the amount of time to attempt to extend the topic's lifetime by + * automatically at the topic's expirationTime, if the autoRenewAccount is configured (once autoRenew functionality + * is supported by HAPI). + * Limited to MIN_AUTORENEW_PERIOD and MAX_AUTORENEW_PERIOD value by server-side configuration. + * Required. + */ Duration autoRenewPeriod = 6; - // Optional account to be used at the topic's expirationTime to extend the life of the topic (once autoRenew - // functionality is supported by HAPI). - // The topic lifetime will be extended up to a maximum of the autoRenewPeriod or however long the topic - // can be extended using all funds on the account (whichever is the smaller duration/amount and if any extension - // is possible with the account's funds). - // If specified, there must be an adminKey and the autoRenewAccount must sign this transaction. + /** + * Optional account to be used at the topic's expirationTime to extend the life of the topic (once autoRenew + * functionality is supported by HAPI). + * The topic lifetime will be extended up to a maximum of the autoRenewPeriod or however long the topic + * can be extended using all funds on the account (whichever is the smaller duration/amount and if any extension + * is possible with the account's funds). + * If specified, there must be an adminKey and the autoRenewAccount must sign this transaction. + */ AccountID autoRenewAccount = 7; } diff --git a/services/ConsensusDeleteTopic.proto b/services/consensus_delete_topic.proto similarity index 83% rename from services/ConsensusDeleteTopic.proto rename to services/consensus_delete_topic.proto index 643960ec..c20b1ce8 100644 --- a/services/ConsensusDeleteTopic.proto +++ b/services/consensus_delete_topic.proto @@ -25,9 +25,14 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "BasicTypes.proto"; +import "basic_types.proto"; -// See [ConsensusService.deleteTopic()](#proto.ConsensusService) +/** + * See [ConsensusService.deleteTopic()](#proto.ConsensusService) + */ message ConsensusDeleteTopicTransactionBody { - TopicID topicID = 1; // Topic identifier. + /** + * Topic identifier + */ + TopicID topicID = 1; } diff --git a/services/ConsensusGetTopicInfo.proto b/services/consensus_get_topic_info.proto similarity index 60% rename from services/ConsensusGetTopicInfo.proto rename to services/consensus_get_topic_info.proto index ae7b7b37..62a6cdc4 100644 --- a/services/ConsensusGetTopicInfo.proto +++ b/services/consensus_get_topic_info.proto @@ -25,27 +25,44 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "BasicTypes.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; -import "ConsensusTopicInfo.proto"; +import "basic_types.proto"; +import "query_header.proto"; +import "response_header.proto"; +import "consensus_topic_info.proto"; -// See [ConsensusService.getTopicInfo()](#proto.ConsensusService) +/** + * See [ConsensusService.getTopicInfo()](#proto.ConsensusService) + */ message ConsensusGetTopicInfoQuery { - // Standard info sent from client to node, including the signed payment, and what kind of response is requested - // (cost, state proof, both, or neither). + /** + * Standard info sent from client to node, including the signed payment, and what kind of response is requested + * (cost, state proof, both, or neither). + */ QueryHeader header = 1; - // The Topic for which information is being requested + /** + * The Topic for which information is being requested + */ TopicID topicID = 2; } -// Retrieve the parameters of and state of a consensus topic. +/** + * Retrieve the parameters of and state of a consensus topic. + */ message ConsensusGetTopicInfoResponse { - // Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither. + /** + * Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither. + */ ResponseHeader header = 1; - TopicID topicID = 2; // Topic identifier. + /** + * Topic identifier. + */ + TopicID topicID = 2; + - ConsensusTopicInfo topicInfo = 5; // Current state of the topic + /** + * Current state of the topic + */ + ConsensusTopicInfo topicInfo = 5; } diff --git a/services/ConsensusService.proto b/services/consensus_service.proto similarity index 63% rename from services/ConsensusService.proto rename to services/consensus_service.proto index 97bc29db..22edf5c4 100644 --- a/services/ConsensusService.proto +++ b/services/consensus_service.proto @@ -24,52 +24,58 @@ package proto; option java_package = "com.hederahashgraph.service.proto.java"; -import "Query.proto"; -import "Response.proto"; -import "TransactionResponse.proto"; -import "Transaction.proto"; +import "query.proto"; +import "response.proto"; +import "transaction_response.proto"; +import "transaction.proto"; -/* The Consensus Service provides the ability for Hedera Hashgraph to provide aBFT consensus as to the order and - * validity of messages submitted to a *topic*, as well as a *consensus timestamp* for those messages. +/** + * The Consensus Service provides the ability for Hedera Hashgraph to provide aBFT consensus as to + * the order and validity of messages submitted to a *topic*, as well as a *consensus timestamp* for + * those messages. * * Automatic renewal can be configured via an autoRenewAccount. - * Any time an autoRenewAccount is added to a topic, that createTopic/updateTopic transaction must be signed by - * the autoRenewAccount. + * Any time an autoRenewAccount is added to a topic, that createTopic/updateTopic transaction must + * be signed by the autoRenewAccount. * - * The autoRenewPeriod on an account must currently be set a value in createTopic between MIN_AUTORENEW_PERIOD (6999999 - * seconds) and MAX_AUTORENEW_PERIOD (8000001 seconds). During creation this sets the initial expirationTime of the - * topic (see more below). + * The autoRenewPeriod on an account must currently be set a value in createTopic between + * MIN_AUTORENEW_PERIOD (6999999 seconds) and MAX_AUTORENEW_PERIOD (8000001 seconds). During + * creation this sets the initial expirationTime of the topic (see more below). * - * If no adminKey is on a topic, there may not be an autoRenewAccount on the topic, deleteTopic is not allowed, - * and the only change allowed via an updateTopic is to extend the expirationTime. + * If no adminKey is on a topic, there may not be an autoRenewAccount on the topic, deleteTopic is + * not allowed, and the only change allowed via an updateTopic is to extend the expirationTime. * - * If an adminKey is on a topic, every updateTopic and deleteTopic transaction must be signed by the adminKey, except - * for updateTopics which only extend the topic's expirationTime (no adminKey authorization required). + * If an adminKey is on a topic, every updateTopic and deleteTopic transaction must be signed by the + * adminKey, except for updateTopics which only extend the topic's expirationTime (no adminKey + * authorization required). * - * If an updateTopic modifies the adminKey of a topic, the transaction signatures on the updateTopic must fulfill both - * the pre-update and post-update adminKey signature requirements. + * If an updateTopic modifies the adminKey of a topic, the transaction signatures on the updateTopic + * must fulfill both the pre-update and post-update adminKey signature requirements. * - * Mirrornet ConsensusService may be used to subscribe to changes on the topic, including changes to the topic - * definition and the consensus ordering and timestamp of submitted messages. + * Mirrornet ConsensusService may be used to subscribe to changes on the topic, including changes to + * the topic definition and the consensus ordering and timestamp of submitted messages. * - * Until autoRenew functionality is supported by HAPI, the topic will not expire, the autoRenewAccount will not be - * charged, and the topic will not automatically be deleted. + * Until autoRenew functionality is supported by HAPI, the topic will not expire, the + * autoRenewAccount will not be charged, and the topic will not automatically be deleted. * * Once autoRenew functionality is supported by HAPI: * - * 1. Once the expirationTime is encountered, if an autoRenewAccount is configured on the topic, the account will be - * charged automatically at the expirationTime, to extend the expirationTime of the topic up to the topic's - * autoRenewPeriod (or as much extension as the account's balance will supply). + * 1. Once the expirationTime is encountered, if an autoRenewAccount is configured on the topic, the + * account will be charged automatically at the expirationTime, to extend the expirationTime of the + * topic up to the topic's autoRenewPeriod (or as much extension as the account's balance will + * supply). * - * 2. If the topic expires and is not automatically renewed, the topic will enter the EXPIRED state. All transactions - * on the topic will fail with TOPIC_EXPIRED, except an updateTopic() call that modifies only the expirationTime. - * getTopicInfo() will succeed. This state will be available for a AUTORENEW_GRACE_PERIOD grace period (7 days). + * 2. If the topic expires and is not automatically renewed, the topic will enter the EXPIRED state. + * All transactions on the topic will fail with TOPIC_EXPIRED, except an updateTopic() call that + * modifies only the expirationTime. getTopicInfo() will succeed. This state will be available for + * a AUTORENEW_GRACE_PERIOD grace period (7 days). * - * 3. After the grace period, if the topic's expirationTime is not extended, the topic will be automatically - * deleted and no transactions or queries on the topic will succeed after that point. + * 3. After the grace period, if the topic's expirationTime is not extended, the topic will be + * automatically deleted and no transactions or queries on the topic will succeed after that point. */ service ConsensusService { - /* Create a topic to be used for consensus. + /** + * Create a topic to be used for consensus. * If an autoRenewAccount is specified, that account must also sign this transaction. * If an adminKey is specified, the adminKey must sign the transaction. * On success, the resulting TransactionReceipt contains the newly created TopicId. @@ -77,7 +83,8 @@ service ConsensusService { */ rpc createTopic (Transaction) returns (TransactionResponse); - /* Update a topic. + /** + * Update a topic. * If there is no adminKey, the only authorized update (available to anyone) is to extend the expirationTime. * Otherwise transaction must be signed by the adminKey. * If an adminKey is updated, the transaction must be signed by the pre-update adminKey and post-update adminKey. @@ -86,21 +93,24 @@ service ConsensusService { */ rpc updateTopic (Transaction) returns (TransactionResponse); - /* Delete a topic. No more transactions or queries on the topic (via HAPI) will succeed. + /** + * Delete a topic. No more transactions or queries on the topic (via HAPI) will succeed. * If an adminKey is set, this transaction must be signed by that key. * If there is no adminKey, this transaction will fail UNAUTHORIZED. * Request is [ConsensusDeleteTopicTransactionBody](#proto.ConsensusDeleteTopicTransactionBody) */ rpc deleteTopic (Transaction) returns (TransactionResponse); - /* Retrieve the latest state of a topic. This method is unrestricted and allowed on any topic by any payer account. + /** + * Retrieve the latest state of a topic. This method is unrestricted and allowed on any topic by any payer account. * Deleted accounts will not be returned. * Request is [ConsensusGetTopicInfoQuery](#proto.ConsensusGetTopicInfoQuery) * Response is [ConsensusGetTopicInfoResponse](#proto.ConsensusGetTopicInfoResponse) */ rpc getTopicInfo (Query) returns (Response); - /* Submit a message for consensus. + /** + * Submit a message for consensus. * Valid and authorized messages on valid topics will be ordered by the consensus service, gossipped to the * mirror net, and published (in order) to all subscribers (from the mirror net) on this topic. * The submitKey (if any) must sign this transaction. diff --git a/services/ConsensusSubmitMessage.proto b/services/consensus_submit_message.proto similarity index 53% rename from services/ConsensusSubmitMessage.proto rename to services/consensus_submit_message.proto index 068ae322..bc482b44 100644 --- a/services/ConsensusSubmitMessage.proto +++ b/services/consensus_submit_message.proto @@ -25,16 +25,44 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "BasicTypes.proto"; +import "basic_types.proto"; +/** + * UNDOCUMENTED + */ message ConsensusMessageChunkInfo { - TransactionID initialTransactionID = 1; // TransactionID of the first chunk, gets copied to every subsequent chunk in a fragmented message. - int32 total = 2; // The total number of chunks in the message. - int32 number = 3; // The sequence number (from 1 to total) of the current chunk in the message. + /** + * TransactionID of the first chunk, gets copied to every subsequent chunk in a fragmented message. + */ + TransactionID initialTransactionID = 1; + + /** + * The total number of chunks in the message. + */ + int32 total = 2; + + /** + * The sequence number (from 1 to total) of the current chunk in the message. + */ + int32 number = 3; } +/** + * UNDOCUMENTED + */ message ConsensusSubmitMessageTransactionBody { - TopicID topicID = 1; // Topic to submit message to. - bytes message = 2; // Message to be submitted. Max size of the Transaction (including signatures) is 6KiB. - ConsensusMessageChunkInfo chunkInfo = 3; // Optional information of the current chunk in a fragmented message. + /** + * Topic to submit message to. + */ + TopicID topicID = 1; + + /** + * Message to be submitted. Max size of the Transaction (including signatures) is 6KiB. + */ + bytes message = 2; + + /** + * Optional information of the current chunk in a fragmented message. + */ + ConsensusMessageChunkInfo chunkInfo = 3; } diff --git a/services/consensus_topic_info.proto b/services/consensus_topic_info.proto new file mode 100644 index 00000000..60ad50fa --- /dev/null +++ b/services/consensus_topic_info.proto @@ -0,0 +1,84 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "timestamp.proto"; + +/** + * Current state of a topic. + */ +message ConsensusTopicInfo { + /** + * The memo associated with the topic (UTF-8 encoding max 100 bytes) + */ + string memo = 1; + + + /** + * When a topic is created, its running hash is initialized to 48 bytes of binary zeros. + * For each submitted message, the topic's running hash is then updated to the output + * of a particular SHA-384 digest whose input data include the previous running hash. + * + * See the TransactionReceipt.proto documentation for an exact description of the + * data included in the SHA-384 digest used for the update. + */ + bytes runningHash = 2; + + /** + * Sequence number (starting at 1 for the first submitMessage) of messages on the topic. + */ + uint64 sequenceNumber = 3; + + /** + * Effective consensus timestamp at (and after) which submitMessage calls will no longer succeed on the topic + * and the topic will expire and after AUTORENEW_GRACE_PERIOD be automatically deleted. + */ + Timestamp expirationTime = 4; + + /** + * Access control for update/delete of the topic. Null if there is no key. + */ + Key adminKey = 5; + + /** + * Access control for ConsensusService.submitMessage. Null if there is no key. + */ + Key submitKey = 6; + + /** + * If an auto-renew account is specified, when the topic expires, its lifetime will be extended + * by up to this duration (depending on the solvency of the auto-renew account). If the + * auto-renew account has no funds at all, the topic will be deleted instead. + */ + Duration autoRenewPeriod = 7; + + /** + * The account, if any, to charge for automatic renewal of the topic's lifetime upon expiry. + */ + AccountID autoRenewAccount = 8; +} diff --git a/services/consensus_update_topic.proto b/services/consensus_update_topic.proto new file mode 100644 index 00000000..55c2df9e --- /dev/null +++ b/services/consensus_update_topic.proto @@ -0,0 +1,89 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "google/protobuf/wrappers.proto"; +import "basic_types.proto"; +import "duration.proto"; +import "timestamp.proto"; + +/** + * All fields left null will not be updated. + * See [ConsensusService.updateTopic()](#proto.ConsensusService) + */ +message ConsensusUpdateTopicTransactionBody { + /** + * UNDOCUMENTED + */ + TopicID topicID = 1; + + /** + * If set, the new memo to be associated with the topic (UTF-8 encoding max 100 bytes) + */ + google.protobuf.StringValue memo = 2; + + /** + * Effective consensus timestamp at (and after) which all consensus transactions and queries will fail. + * The expirationTime may be no longer than MAX_AUTORENEW_PERIOD (8000001 seconds) from the consensus timestamp of + * this transaction. + * On topics with no adminKey, extending the expirationTime is the only updateTopic option allowed on the topic. + * If unspecified, no change. + */ + Timestamp expirationTime = 4; + + /** + * Access control for update/delete of the topic. + * If unspecified, no change. + * If empty keyList - the adminKey is cleared. + */ + Key adminKey = 6; + + /** + * Access control for ConsensusService.submitMessage. + * If unspecified, no change. + * If empty keyList - the submitKey is cleared. + */ + Key submitKey = 7; + + /* + * The amount of time to extend the topic's lifetime automatically at expirationTime if the autoRenewAccount is + * configured and has funds (once autoRenew functionality is supported by HAPI). + * Limited to between MIN_AUTORENEW_PERIOD (6999999 seconds) and MAX_AUTORENEW_PERIOD (8000001 seconds) by + * servers-side configuration (which may change). + * If unspecified, no change. + */ + Duration autoRenewPeriod = 8; + + /** + * Optional account to be used at the topic's expirationTime to extend the life of the topic. + * Once autoRenew functionality is supported by HAPI, the topic lifetime will be extended up to a maximum of the + * autoRenewPeriod or however long the topic can be extended using all funds on the account (whichever is the + * smaller duration/amount). + * If specified as the default value (0.0.0), the autoRenewAccount will be removed. + * If unspecified, no change. + */ + AccountID autoRenewAccount = 9; +} diff --git a/services/contract_call.proto b/services/contract_call.proto new file mode 100644 index 00000000..3d1124dd --- /dev/null +++ b/services/contract_call.proto @@ -0,0 +1,62 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Call a function of the given smart contract instance, giving it functionParameters as its inputs. + * The call can use at maximum the given amount of gas – the paying account will not be charged for + * any unspent gas. + * + * If this function results in data being stored, an amount of gas is calculated that reflects this + * storage burden. + * + * The amount of gas used, as well as other attributes of the transaction, e.g. size, number of + * signatures to be verified, determine the fee for the transaction – which is charged to the paying + * account. + */ +message ContractCallTransactionBody { + /** + * the contract instance to call, in the format used in transactions + */ + ContractID contractID = 1; + + /** + * the maximum amount of gas to use for the call + */ + int64 gas = 2; + + /** + * number of tinybars sent (the function must be payable if this is nonzero) + */ + int64 amount = 3; + + /** + * which function to call, and the parameters to pass to the function + */ + bytes functionParameters = 4; +} diff --git a/services/contract_call_local.proto b/services/contract_call_local.proto new file mode 100644 index 00000000..12ff7742 --- /dev/null +++ b/services/contract_call_local.proto @@ -0,0 +1,152 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "query_header.proto"; +import "response_header.proto"; + +/** + * The log information for an event returned by a smart contract function call. One function call + * may return several such events. + */ +message ContractLoginfo { + /** + * address of a contract that emitted the event + */ + ContractID contractID = 1; + + /** + * bloom filter for a particular log + */ + bytes bloom = 2; + + /** + * topics of a particular event + */ + repeated bytes topic = 3; + + /** + * event data + */ + bytes data = 4; +} + +/** + * The result returned by a call to a smart contract function. This is part of the response to a + * ContractCallLocal query, and is in the record for a ContractCall or ContractCreateInstance + * transaction. The ContractCreateInstance transaction record has the results of the call to the + * constructor. + */ +message ContractFunctionResult { + /** + * the smart contract instance whose function was called + */ + ContractID contractID = 1; + + /** + * the result returned by the function + */ + bytes contractCallResult = 2; + + /** + * message In case there was an error during smart contract execution + */ + string errorMessage = 3; + + /** + * bloom filter for record + */ + bytes bloom = 4; + + /** + * units of gas used to execute contract + */ + uint64 gasUsed = 5; + + /** + * the log info for events returned by the function + */ + repeated ContractLoginfo logInfo = 6; + + /** + * the list of smart contracts that were created by the function call + */ + repeated ContractID createdContractIDs = 7; +} + +/** + * Call a function of the given smart contract instance, giving it functionParameters as its inputs. + * This is performed locally on the particular node that the client is communicating with. + * It cannot change the state of the contract instance (and so, cannot spend anything from the instance's cryptocurrency account). + * It will not have a consensus timestamp. It cannot generate a record or a receipt. The response will contain the output + * returned by the function call. This is useful for calling getter functions, which purely read the state and don't change it. + * It is faster and cheaper than a normal call, because it is purely local to a single node. + * + * Unlike a ContractCall transaction, the node will consume the entire amount of provided gas in determining + * the fee for this query. + */ +message ContractCallLocalQuery { + /** + * standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). The payment must cover the fees and all of the gas offered. + */ + QueryHeader header = 1; + + /** + * the contract instance to call, in the format used in transactions + */ + ContractID contractID = 2; + + /** + * The amount of gas to use for the call; all of the gas offered will be used and charged a corresponding fee + */ + int64 gas = 3; + + /** + * which function to call, and the parameters to pass to the function + */ + bytes functionParameters = 4; + + /** + * max number of bytes that the result might include. The run will fail if it would have returned more than this number of bytes. + */ + int64 maxResultSize = 5 [deprecated=true]; +} + +/** + * Response when the client sends the node ContractCallLocalQuery + */ +message ContractCallLocalResponse { + /** + * standard response from node to client, including the requested fields: cost, or state proof, or both, or neither + */ + ResponseHeader header = 1; + + /** + * the value returned by the function (if it completed and didn't fail) + */ + ContractFunctionResult functionResult = 2; +} diff --git a/services/contract_create.proto b/services/contract_create.proto new file mode 100644 index 00000000..d1af34f5 --- /dev/null +++ b/services/contract_create.proto @@ -0,0 +1,150 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; + +/** + * Start a new smart contract instance. After the instance is created, the ContractID for it is in + * the receipt, and can be retrieved by the Record or with a GetByKey query. The instance will run + * the bytecode stored in a previously created file, referenced either by FileID or by the + * transaction ID of the transaction that created the file + * + * + * The constructor will be executed using the given amount of gas, and any unspent gas will be + * refunded to the paying account. Constructor inputs come from the given constructorParameters. + * - The instance will exist for autoRenewPeriod seconds. When that is reached, it will renew + * itself for another autoRenewPeriod seconds by charging its associated cryptocurrency account + * (which it creates here). If it has insufficient cryptocurrency to extend that long, it will + * extend as long as it can. If its balance is zero, the instance will be deleted. + * + * - A smart contract instance normally enforces rules, so "the code is law". For example, an + * ERC-20 contract prevents a transfer from being undone without a signature by the recipient of + * the transfer. This is always enforced if the contract instance was created with the adminKeys + * being null. But for some uses, it might be desirable to create something like an ERC-20 + * contract that has a specific group of trusted individuals who can act as a "supreme court" + * with the ability to override the normal operation, when a sufficient number of them agree to + * do so. If adminKeys is not null, then they can sign a transaction that can change the state of + * the smart contract in arbitrary ways, such as to reverse a transaction that violates some + * standard of behavior that is not covered by the code itself. The admin keys can also be used + * to change the autoRenewPeriod, and change the adminKeys field itself. The API currently does + * not implement this ability. But it does allow the adminKeys field to be set and queried, and + * will in the future implement such admin abilities for any instance that has a non-null + * adminKeys. + * + * - If this constructor stores information, it is charged gas to store it. There is a fee in hbars + * to maintain that storage until the expiration time, and that fee is added as part of the + * transaction fee. + * + * - An entity (account, file, or smart contract instance) must be created in a particular realm. + * If the realmID is left null, then a new realm will be created with the given admin key. If a + * new realm has a null adminKey, then anyone can create/modify/delete entities in that realm. + * But if an admin key is given, then any transaction to create/modify/delete an entity in that + * realm must be signed by that key, though anyone can still call functions on smart contract + * instances that exist in that realm. A realm ceases to exist when everything within it has + * expired and no longer exists. + * + * - The current API ignores shardID, realmID, and newRealmAdminKey, and creates everything in + * shard 0 and realm 0, with a null key. Future versions of the API will support multiple realms + * and multiple shards. + * + * - The optional memo field can contain a string whose length is up to 100 bytes. That is the size + * after Unicode NFD then UTF-8 conversion. This field can be used to describe the smart contract. + * It could also be used for other purposes. One recommended purpose is to hold a hexadecimal + * string that is the SHA-384 hash of a PDF file containing a human-readable legal contract. Then, + * if the admin keys are the public keys of human arbitrators, they can use that legal document to + * guide their decisions during a binding arbitration tribunal, convened to consider any changes + * to the smart contract in the future. The memo field can only be changed using the admin keys. + * If there are no admin keys, then it cannot be changed after the smart contract is created. + */ +message ContractCreateTransactionBody { + /** + * the file containing the smart contract byte code. A copy will be made and held by the + * contract instance, and have the same expiration time as the instance. The file is referenced + * one of two ways: + */ + FileID fileID = 1; + + /** + * the state of the instance and its fields can be modified arbitrarily if this key signs a + * transaction to modify it. If this is null, then such modifications are not possible, and + * there is no administrator that can override the normal operation of this smart contract + * instance. Note that if it is created with no admin keys, then there is no administrator to + * authorize changing the admin keys, so there can never be any admin keys for that instance. + */ + Key adminKey = 3; + + /** + * gas to run the constructor + */ + int64 gas = 4; + + /** + * initial number of tinybars to put into the cryptocurrency account associated with and owned + * by the smart contract + */ + int64 initialBalance = 5; + + /** + * ID of the account to which this account is proxy staked. If proxyAccountID is null, or is an + * invalid account, or is an account that isn't a node, then this account is automatically proxy + * staked to a node chosen by the network, but without earning payments. If the proxyAccountID + * account refuses to accept proxy staking , or if it is not currently running a node, then it + * will behave as if proxyAccountID was null. + */ + AccountID proxyAccountID = 6; + + /** + * the instance will charge its account every this many seconds to renew for this long + */ + Duration autoRenewPeriod = 8; + + /** + * parameters to pass to the constructor + */ + bytes constructorParameters = 9; + + /** + * shard in which to create this + */ + ShardID shardID = 10; + + /** + * realm in which to create this (leave this null to create a new realm) + */ + RealmID realmID = 11; + + /** + * if realmID is null, then this the admin key for the new realm that will be created + */ + Key newRealmAdminKey = 12; + + /** + * the memo that was submitted as part of the contract (max 100 bytes) + */ + string memo = 13; +} diff --git a/services/ContractDelete.proto b/services/contract_delete.proto similarity index 56% rename from services/ContractDelete.proto rename to services/contract_delete.proto index 0146e924..03392ca7 100644 --- a/services/ContractDelete.proto +++ b/services/contract_delete.proto @@ -24,23 +24,34 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "BasicTypes.proto"; +import "basic_types.proto"; -/* -At consensus, marks a contract as deleted and transfers its remaining hBars, if any, to a designated receiver. After a contract is deleted, it can no longer be called. - -If the target contract is immutable (that is, was created without an admin key), then this transaction resolves to MODIFYING_IMMUTABLE_CONTRACT. - ---- Signing Requirements --- -1. The admin key of the target contract must sign. -2. If the transfer account or contract has receiverSigRequired, its associated key must also sign. */ +/** + * At consensus, marks a contract as deleted and transfers its remaining hBars, if any, to a + * designated receiver. After a contract is deleted, it can no longer be called. + * + * If the target contract is immutable (that is, was created without an admin key), then this + * transaction resolves to MODIFYING_IMMUTABLE_CONTRACT. + * + * --- Signing Requirements --- + * 1. The admin key of the target contract must sign. + * 2. If the transfer account or contract has receiverSigRequired, its associated key must also sign + */ message ContractDeleteTransactionBody { - // The id of the contract to be deleted + /** + * The id of the contract to be deleted + */ ContractID contractID = 1; + oneof obtainers { - // The id of an account to receive any remaining hBars from the deleted contract + /** + * The id of an account to receive any remaining hBars from the deleted contract + */ AccountID transferAccountID = 2; - // The id of a contract to receive any remaining hBars from the deleted contract + + /** + * The id of a contract to receive any remaining hBars from the deleted contract + */ ContractID transferContractID = 3; } } diff --git a/services/ContractGetBytecode.proto b/services/contract_get_bytecode.proto similarity index 53% rename from services/ContractGetBytecode.proto rename to services/contract_get_bytecode.proto index 7a3e42b8..469d2639 100644 --- a/services/ContractGetBytecode.proto +++ b/services/contract_get_bytecode.proto @@ -25,19 +25,39 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "BasicTypes.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; +import "basic_types.proto"; +import "query_header.proto"; +import "response_header.proto"; -/* Get the bytecode for a smart contract instance */ +/** + * Get the bytecode for a smart contract instance + */ message ContractGetBytecodeQuery { - QueryHeader header = 1; // standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). - ContractID contractID = 2; // the contract for which information is requested + /** + * standard info sent from client to node, including the signed payment, and what kind of + * response is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + /** + * the contract for which information is requested + */ + ContractID contractID = 2; } -/* Response when the client sends the node ContractGetBytecodeQuery */ +/** + * Response when the client sends the node ContractGetBytecodeQuery + */ message ContractGetBytecodeResponse { - ResponseHeader header = 1; //standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - bytes bytecode = 6; // the bytecode + /** + * standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither + */ + ResponseHeader header = 1; + + /** + * the bytecode + */ + bytes bytecode = 6; } diff --git a/services/contract_get_info.proto b/services/contract_get_info.proto new file mode 100644 index 00000000..7ddcccec --- /dev/null +++ b/services/contract_get_info.proto @@ -0,0 +1,133 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "timestamp.proto"; +import "duration.proto"; +import "basic_types.proto"; +import "query_header.proto"; +import "response_header.proto"; + +/** + * Get information about a smart contract instance. This includes the account that it uses, the file + * containing its bytecode, and the time when it will expire. + */ +message ContractGetInfoQuery { + /** + * standard info sent from client to node, including the signed payment, and what kind of + * response is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + /** + * the contract for which information is requested + */ + ContractID contractID = 2; +} + +/** + * Response when the client sends the node ContractGetInfoQuery + */ +message ContractGetInfoResponse { + /** + * standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither + */ + ResponseHeader header = 1; + + message ContractInfo { + /** + * ID of the contract instance, in the format used in transactions + */ + ContractID contractID = 1; + + /** + * ID of the cryptocurrency account owned by the contract instance, in the format used in + * transactions + */ + AccountID accountID = 2; + + /** + * ID of both the contract instance and the cryptocurrency account owned by the contract + * instance, in the format used by Solidity + */ + string contractAccountID = 3; + + /** + * the state of the instance and its fields can be modified arbitrarily if this key signs a + * transaction to modify it. If this is null, then such modifications are not possible, and + * there is no administrator that can override the normal operation of this smart contract + * instance. Note that if it is created with no admin keys, then there is no administrator + * to authorize changing the admin keys, so there can never be any admin keys for that + * instance. + */ + Key adminKey = 4; + + /** + * the current time at which this contract instance (and its account) is set to expire + */ + Timestamp expirationTime = 5; + + /** + * the expiration time will extend every this many seconds. If there are insufficient funds, + * then it extends as long as possible. If the account is empty when it expires, then it is + * deleted. + */ + Duration autoRenewPeriod = 6; + + /** + * number of bytes of storage being used by this instance (which affects the cost to extend + * the expiration time) + */ + int64 storage = 7; + + /** + * the memo associated with the contract (max 100 bytes) + */ + string memo = 8; + + /** + * The current balance, in tinybars + */ + uint64 balance = 9; + + /** + * Whether the contract has been deleted + */ + bool deleted = 10; + + /** + * The tokens associated to the contract + */ + repeated TokenRelationship tokenRelationships = 11; + } + + /** + * the information about this contract instance (a state proof can be generated for this) + */ + ContractInfo contractInfo = 2; +} + diff --git a/services/ContractGetRecords.proto b/services/contract_get_records.proto similarity index 50% rename from services/ContractGetRecords.proto rename to services/contract_get_records.proto index 9f36b1ba..a87e2505 100644 --- a/services/ContractGetRecords.proto +++ b/services/contract_get_records.proto @@ -25,22 +25,44 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "BasicTypes.proto"; -import "TransactionRecord.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; +import "basic_types.proto"; +import "transaction_record.proto"; +import "query_header.proto"; +import "response_header.proto"; -// Before v0.9.0, requested records of all transactions against the given contract in the last 25 hours. +/** + * Before v0.9.0, requested records of all transactions against the given contract in the last 25 hours. + */ message ContractGetRecordsQuery { option deprecated = true; - QueryHeader header = 1; // Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). - ContractID contractID = 2; // The smart contract instance for which the records should be retrieved + /** + * Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + /** + * The smart contract instance for which the records should be retrieved + */ + ContractID contractID = 2; } -// Before v0.9.0, returned records of all transactions against the given contract in the last 25 hours. +/** + * Before v0.9.0, returned records of all transactions against the given contract in the last 25 hours. + */ message ContractGetRecordsResponse { option deprecated = true; - ResponseHeader header = 1; //Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - ContractID contractID = 2; // The smart contract instance that this record is for - repeated TransactionRecord records = 3; // List of records, each with contractCreateResult or contractCallResult as its body + /** + * Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither + */ + ResponseHeader header = 1; + + /** + * The smart contract instance that this record is for + */ + ContractID contractID = 2; + + /** + * List of records, each with contractCreateResult or contractCallResult as its body + */ + repeated TransactionRecord records = 3; } diff --git a/services/contract_update.proto b/services/contract_update.proto new file mode 100644 index 00000000..dfc6f265 --- /dev/null +++ b/services/contract_update.proto @@ -0,0 +1,100 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +/** + * At consensus, updates the fields of a smart contract to the given values. + * + * If no value is given for a field, that field is left unchanged on the contract. For an immutable + * smart contract (that is, a contract created without an adminKey), only the expirationTime may be + * updated; setting any other field in this case will cause the transaction status to resolve to + * MODIFYING_IMMUTABLE_CONTRACT. + * + * --- Signing Requirements --- + * 1. Whether or not a contract has an admin Key, its expiry can be extended with only the + * transaction payer's signature. + * 2. Updating any other field of a mutable contract requires the admin key's signature. + * 3. If the update transaction includes a new admin key, this new key must also sign unless + * it is exactly an empty KeyList. This special sentinel key removes the existing admin + * key and causes the contract to become immutable. (Other Key structures without a + * constituent Ed25519 key will be rejected with INVALID_ADMIN_KEY.) + */ +message ContractUpdateTransactionBody { + /** + * The id of the contract to be updated + */ + ContractID contractID = 1; + + /** + * The new expiry of the contract, no earlier than the current expiry (resolves to + * EXPIRATION_REDUCTION_NOT_ALLOWED otherwise) + */ + Timestamp expirationTime = 2; + + /** + * The new key to control updates to the contract + */ + Key adminKey = 3; + + /** + * (NOT YET IMPLEMENTED) The new id of the account to which the contract is proxy staked + */ + AccountID proxyAccountID = 6; + + /** + * (NOT YET IMPLEMENTED) The new interval at which the contract will pay to extend its expiry + * (by the same interval) + */ + Duration autoRenewPeriod = 7; + + /** + * The new id of the file asserted to contain the bytecode of the Solidity transaction that + * created this contract + */ + FileID fileID = 8 [deprecated = true]; + + /** + * The new contract memo, assumed to be Unicode encoded with UTF-8 (at most 100 bytes) + */ + oneof memoField { + /** + * [Deprecated] If set with a non-zero length, the new memo to be associated with the account + * (UTF-8 encoding max 100 bytes) + */ + string memo = 9 [deprecated = true]; + + /** + * If set, the new memo to be associated with the account (UTF-8 encoding max 100 bytes) + */ + google.protobuf.StringValue memoWrapper = 10; + } +} + diff --git a/services/crypto_add_live_hash.proto b/services/crypto_add_live_hash.proto new file mode 100644 index 00000000..17620ce9 --- /dev/null +++ b/services/crypto_add_live_hash.proto @@ -0,0 +1,74 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + + +import "basic_types.proto"; +import "duration.proto"; + +/** + * A hash---presumably of some kind of credential or certificate---along with a list of keys, each + * of which may be either a primitive or a threshold key. + */ +message LiveHash { + /** + * The account to which the livehash is attached + */ + AccountID accountId = 1; + + /** + * The SHA-384 hash of a credential or certificate + */ + bytes hash = 2; + + /** + * A list of keys (primitive or threshold), all of which must sign to attach the livehash to an account, and any one of which can later delete it. + */ + KeyList keys = 3; + + /** + * The duration for which the livehash will remain valid + */ + Duration duration = 5; +} + +/** + * At consensus, attaches the given livehash to the given account. The hash can be deleted by the + * key controlling the account, or by any of the keys associated to the livehash. Hence livehashes + * provide a revocation service for their implied credentials; for example, when an authority grants + * a credential to the account, the account owner will cosign with the authority (or authorities) to + * attach a hash of the credential to the account---hence proving the grant. If the credential is + * revoked, then any of the authorities may delete it (or the account owner). In this way, the + * livehash mechanism acts as a revocation service. An account cannot have two identical livehashes + * associated. To modify the list of keys in a livehash, the livehash should first be deleted, then + * recreated with a new list of keys. + */ +message CryptoAddLiveHashTransactionBody { + /** + * A hash of some credential or certificate, along with the keys of the entities that asserted it validity + */ + LiveHash liveHash = 3; +} diff --git a/services/crypto_create.proto b/services/crypto_create.proto new file mode 100644 index 00000000..95854f90 --- /dev/null +++ b/services/crypto_create.proto @@ -0,0 +1,133 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; + +/* + * Create a new account. After the account is created, the AccountID for it is in the receipt. It + * can also be retrieved with a GetByKey query. Threshold values can be defined, and records are + * generated and stored for 25 hours for any transfer that exceeds the thresholds. This account is + * charged for each record generated, so the thresholds are useful for limiting record generation to + * happen only for large transactions. + * + * The Key field is the key used to sign transactions for this account. If the account has + * receiverSigRequired set to true, then all cryptocurrency transfers must be signed by this + * account's key, both for transfers in and out. If it is false, then only transfers out have to be + * signed by it. When the account is created, the payer account is charged enough hbars so that the + * new account will not expire for the next autoRenewPeriod seconds. When it reaches the expiration + * time, the new account will then be automatically charged to renew for another autoRenewPeriod + * seconds. If it does not have enough hbars to renew for that long, then the remaining hbars are + * used to extend its expiration as long as possible. If it is has a zero balance when it expires, + * then it is deleted. This transaction must be signed by the payer account. If receiverSigRequired + * is false, then the transaction does not have to be signed by the keys in the keys field. If it is + * true, then it must be signed by them, in addition to the keys of the payer account. + * + * An entity (account, file, or smart contract instance) must be created in a particular realm. If + * the realmID is left null, then a new realm will be created with the given admin key. If a new + * realm has a null adminKey, then anyone can create/modify/delete entities in that realm. But if an + * admin key is given, then any transaction to create/modify/delete an entity in that realm must be + * signed by that key, though anyone can still call functions on smart contract instances that exist + * in that realm. A realm ceases to exist when everything within it has expired and no longer + * exists. + * + * The current API ignores shardID, realmID, and newRealmAdminKey, and creates everything in shard 0 + * and realm 0, with a null key. Future versions of the API will support multiple realms and + * multiple shards. + */ +message CryptoCreateTransactionBody { + /** + * The key that must sign each transfer out of the account. If receiverSigRequired is true, then + * it must also sign any transfer into the account. + */ + Key key = 1; + + /** + * The initial number of tinybars to put into the account + */ + uint64 initialBalance = 2; + + /** + * ID of the account to which this account is proxy staked. If proxyAccountID is null, or is an + * invalid account, or is an account that isn't a node, then this account is automatically proxy + * staked to a node chosen by the network, but without earning payments. If the proxyAccountID + * account refuses to accept proxy staking , or if it is not currently running a node, then it + * will behave as if proxyAccountID was null. + */ + AccountID proxyAccountID = 3; + + /** + * [Deprecated]. The threshold amount (in tinybars) for which an account record is created for + * any send/withdraw transaction + */ + uint64 sendRecordThreshold = 6 [deprecated=true]; + + /** + * [Deprecated]. The threshold amount (in tinybars) for which an account record is created for + * any receive/deposit transaction + */ + uint64 receiveRecordThreshold = 7 [deprecated=true]; + + /** + * If true, this account's key must sign any transaction depositing into this account (in + * addition to all withdrawals) + */ + bool receiverSigRequired = 8; + + /** + * The account is charged to extend its expiration date every this many seconds. If it doesn't + * have enough balance, it extends as long as possible. If it is empty when it expires, then it + * is deleted. + */ + Duration autoRenewPeriod = 9; + + /** + * The shard in which this account is created + */ + ShardID shardID = 10; + + /** + * The realm in which this account is created (leave this null to create a new realm) + */ + RealmID realmID = 11; + + /** + * If realmID is null, then this the admin key for the new realm that will be created + */ + Key newRealmAdminKey = 12; + + /** + * The memo associated with the account (UTF-8 encoding max 100 bytes) + */ + string memo = 13; + + /** + * The maximum number of tokens that an Account can be implicitly associated with. Defaults to 0 + * and up to a maximum value of 1000. + */ + int32 max_automatic_token_associations = 14; +} diff --git a/services/CryptoDelete.proto b/services/crypto_delete.proto similarity index 61% rename from services/CryptoDelete.proto rename to services/crypto_delete.proto index 16452a54..6c70d12c 100644 --- a/services/CryptoDelete.proto +++ b/services/crypto_delete.proto @@ -25,10 +25,21 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "BasicTypes.proto"; +import "basic_types.proto"; -/* Mark an account as deleted, moving all its current hbars to another account. It will remain in the ledger, marked as deleted, until it expires. Transfers into it a deleted account fail. But a deleted account can still have its expiration extended in the normal way. */ +/** + * Mark an account as deleted, moving all its current hbars to another account. It will remain in + * the ledger, marked as deleted, until it expires. Transfers into it a deleted account fail. But a + * deleted account can still have its expiration extended in the normal way. + */ message CryptoDeleteTransactionBody { - AccountID transferAccountID = 1; // The account ID which will receive all remaining hbars - AccountID deleteAccountID = 2; // The account ID which should be deleted + /** + * The account ID which will receive all remaining hbars + */ + AccountID transferAccountID = 1; + + /** + * The account ID which should be deleted + */ + AccountID deleteAccountID = 2; } diff --git a/services/CryptoDeleteLiveHash.proto b/services/crypto_delete_live_hash.proto similarity index 71% rename from services/CryptoDeleteLiveHash.proto rename to services/crypto_delete_live_hash.proto index ecb66b20..b4850d67 100644 --- a/services/CryptoDeleteLiveHash.proto +++ b/services/crypto_delete_live_hash.proto @@ -25,12 +25,20 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "BasicTypes.proto"; +import "basic_types.proto"; -/* At consensus, deletes a livehash associated to the given account. The transaction must be signed by either the key of the owning account, or at least one of the keys associated to the livehash. */ +/** + * At consensus, deletes a livehash associated to the given account. The transaction must be signed + * by either the key of the owning account, or at least one of the keys associated to the livehash. + */ message CryptoDeleteLiveHashTransactionBody { - // The account owning the livehash + /** + * The account owning the livehash + */ AccountID accountOfLiveHash = 1; - // The SHA-384 livehash to delete from the account + + /** + * The SHA-384 livehash to delete from the account + */ bytes liveHashToDelete = 2; } diff --git a/services/crypto_get_account_balance.proto b/services/crypto_get_account_balance.proto new file mode 100644 index 00000000..cca5944d --- /dev/null +++ b/services/crypto_get_account_balance.proto @@ -0,0 +1,82 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "query_header.proto"; +import "response_header.proto"; +import "timestamp.proto"; + +/** + * Get the balance of a cryptocurrency account. This returns only the balance, so it is a smaller + * reply than CryptoGetInfo, which returns the balance plus additional information. + */ +message CryptoGetAccountBalanceQuery { + /** + * Standard info sent from client to node, including the signed payment, and what kind of + * response is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + oneof balanceSource { + /** + * The account ID for which information is requested + */ + AccountID accountID = 2; + + /** + * The account ID for which information is requested + */ + ContractID contractID = 3; + } +} + +/** + * Response when the client sends the node CryptoGetAccountBalanceQuery + */ +message CryptoGetAccountBalanceResponse { + /** + * Standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither. + */ + ResponseHeader header = 1; + + /** + * The account ID that is being described (this is useful with state proofs, for proving to a + * third party) + */ + AccountID accountID = 2; + + /** + * The current balance, in tinybars. + */ + uint64 balance = 3; + + /** + * The token balances possessed by the target account. + */ + repeated TokenBalance tokenBalances = 4; +} diff --git a/services/CryptoGetAccountRecords.proto b/services/crypto_get_account_records.proto similarity index 56% rename from services/CryptoGetAccountRecords.proto rename to services/crypto_get_account_records.proto index 2431c1bd..bfb7c1cf 100644 --- a/services/CryptoGetAccountRecords.proto +++ b/services/crypto_get_account_records.proto @@ -25,22 +25,44 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "BasicTypes.proto"; -import "TransactionRecord.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; +import "basic_types.proto"; +import "transaction_record.proto"; +import "query_header.proto"; +import "response_header.proto"; -// Requests records of all transactions for which the given account was the effective payer in the last 3 minutes of consensus time and ledger.keepRecordsInState=true was true during handleTransaction. +/** + * Requests records of all transactions for which the given account was the effective payer in the last 3 minutes of consensus time and ledger.keepRecordsInState=true was true during handleTransaction. + */ message CryptoGetAccountRecordsQuery { - QueryHeader header = 1; // Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). - AccountID accountID = 2; // The account ID for which the records should be retrieved + /** + * Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + /** + * The account ID for which the records should be retrieved + */ + AccountID accountID = 2; } -// Returns records of all transactions for which the given account was the effective payer in the last 3 minutes of consensus time and ledger.keepRecordsInState=true was true during handleTransaction. +/** + * Returns records of all transactions for which the given account was the effective payer in the last 3 minutes of consensus time and ledger.keepRecordsInState=true was true during handleTransaction. + */ message CryptoGetAccountRecordsResponse { - ResponseHeader header = 1; // Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither - AccountID accountID = 2; // The account that this record is for - repeated TransactionRecord records = 3; // List of records + /** + * Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither + */ + ResponseHeader header = 1; + + /** + * The account that this record is for + */ + AccountID accountID = 2; + + /** + * List of records + */ + repeated TransactionRecord records = 3; } diff --git a/services/crypto_get_info.proto b/services/crypto_get_info.proto new file mode 100644 index 00000000..bbc4a8cf --- /dev/null +++ b/services/crypto_get_info.proto @@ -0,0 +1,171 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "timestamp.proto"; +import "duration.proto"; +import "basic_types.proto"; +import "query_header.proto"; +import "response_header.proto"; +import "crypto_add_live_hash.proto"; + +/** + * Get all the information about an account, including the balance. This does not get the list of + * account records. + */ +message CryptoGetInfoQuery { + /** + * Standard info sent from client to node, including the signed payment, and what kind of + * response is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + /** + * The account ID for which information is requested + */ + AccountID accountID = 2; +} + +/** + * Response when the client sends the node CryptoGetInfoQuery + */ +message CryptoGetInfoResponse { + /** + * Standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither + */ + ResponseHeader header = 1; + + + message AccountInfo { + /** + * The account ID for which this information applies + */ + AccountID accountID = 1; + + /** + * The Contract Account ID comprising of both the contract instance and the cryptocurrency + * account owned by the contract instance, in the format used by Solidity + */ + string contractAccountID = 2; + + /** + * If true, then this account has been deleted, it will disappear when it expires, and all + * transactions for it will fail except the transaction to extend its expiration date + */ + bool deleted = 3; + + /** + * The Account ID of the account to which this is proxy staked. If proxyAccountID is null, + * or is an invalid account, or is an account that isn't a node, then this account is + * automatically proxy staked to a node chosen by the network, but without earning payments. + * If the proxyAccountID account refuses to accept proxy staking , or if it is not currently + * running a node, then it will behave as if proxyAccountID was null. + */ + AccountID proxyAccountID = 4; + + /** + * The total number of tinybars proxy staked to this account + */ + int64 proxyReceived = 6; + + /** + * The key for the account, which must sign in order to transfer out, or to modify the + * account in any way other than extending its expiration date. + */ + Key key = 7; + + /** + * The current balance of account in tinybars + */ + uint64 balance = 8; + + /** + * [Deprecated]. The threshold amount, in tinybars, at which a record is created of any + * transaction that decreases the balance of this account by more than the threshold + */ + uint64 generateSendRecordThreshold = 9 [deprecated=true]; + + /** + * [Deprecated]. The threshold amount, in tinybars, at which a record is created of any + * transaction that increases the balance of this account by more than the threshold + */ + uint64 generateReceiveRecordThreshold = 10 [deprecated=true]; + + /** + * If true, no transaction can transfer to this account unless signed by this account's key + */ + bool receiverSigRequired = 11; + + /** + * The TimeStamp time at which this account is set to expire + */ + Timestamp expirationTime = 12; + + /** + * The duration for expiration time will extend every this many seconds. If there are + * insufficient funds, then it extends as long as possible. If it is empty when it expires, + * then it is deleted. + */ + Duration autoRenewPeriod = 13; + + /** + * All of the livehashes attached to the account (each of which is a hash along with the + * keys that authorized it and can delete it) + */ + repeated LiveHash liveHashes = 14; + + /** + * All tokens related to this account + */ + repeated TokenRelationship tokenRelationships = 15; + + /** + * The memo associated with the account + */ + string memo = 16; + + /** + * The number of NFTs owned by this account + */ + int64 ownedNfts = 17; + + /** + * The maximum number of tokens that an Account can be implicitly associated with. + */ + int32 max_automatic_token_associations = 18; + + /** + * The alias of this account + */ + bytes alias = 19; + } + + /** + * Info about the account (a state proof can be generated for this) + */ + AccountInfo accountInfo = 2; +} diff --git a/services/CryptoGetLiveHash.proto b/services/crypto_get_live_hash.proto similarity index 51% rename from services/CryptoGetLiveHash.proto rename to services/crypto_get_live_hash.proto index dedf205a..f1299e48 100644 --- a/services/CryptoGetLiveHash.proto +++ b/services/crypto_get_live_hash.proto @@ -25,26 +25,47 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "BasicTypes.proto"; -import "QueryHeader.proto"; -import "ResponseHeader.proto"; -import "CryptoAddLiveHash.proto"; +import "basic_types.proto"; +import "query_header.proto"; +import "response_header.proto"; +import "crypto_add_live_hash.proto"; -/* Requests a livehash associated to an account. */ +/** + * Requests a livehash associated to an account. + */ message CryptoGetLiveHashQuery { - // Standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). + /** + * Standard info sent from client to node, including the signed payment, and what kind of + * response is requested (cost, state proof, both, or neither). + */ QueryHeader header = 1; - // The account to which the livehash is associated + + /** + * The account to which the livehash is associated + */ AccountID accountID = 2; - // The SHA-384 data in the livehash + + /** + * The SHA-384 data in the livehash + */ bytes hash = 3; } -/* Returns the full livehash associated to an account, if it is present. Note that the only way to obtain a state proof exhibiting the absence of a livehash from an account is to retrieve a state proof of the entire account with its list of livehashes. */ +/** + * Returns the full livehash associated to an account, if it is present. Note that the only way to + * obtain a state proof exhibiting the absence of a livehash from an account is to retrieve a state + * proof of the entire account with its list of livehashes. + */ message CryptoGetLiveHashResponse { - // Standard response from node to client, including the requested fields: cost, or state proof, or both, or neither + /** + * Standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither + */ ResponseHeader header = 1; - // The livehash, if present + + /** + * The livehash, if present + */ LiveHash liveHash = 2; } diff --git a/services/crypto_get_stakers.proto b/services/crypto_get_stakers.proto new file mode 100644 index 00000000..6184fa52 --- /dev/null +++ b/services/crypto_get_stakers.proto @@ -0,0 +1,94 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "query_header.proto"; +import "response_header.proto"; + +/** + * Get all the accounts that are proxy staking to this account. For each of them, give the amount + * currently staked. This is not yet implemented, but will be in a future version of the API. + */ +message CryptoGetStakersQuery { + /** + * Standard info sent from client to node, including the signed payment, and what kind of + * response is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + /** + * The Account ID for which the records should be retrieved + */ + AccountID accountID = 2; +} + +/** + * information about a single account that is proxy staking + */ +message ProxyStaker { + /** + * The Account ID that is proxy staking + */ + AccountID accountID = 1; + + /** + * The number of hbars that are currently proxy staked + */ + int64 amount = 2; +} + +/** + * all of the accounts proxy staking to a given account, and the amounts proxy staked + */ +message AllProxyStakers { + /** + * The Account ID that is being proxy staked to + */ + AccountID accountID = 1; + + /** + * Each of the proxy staking accounts, and the amount they are proxy staking + */ + repeated ProxyStaker proxyStaker = 2; +} + +/** + * Response when the client sends the node CryptoGetStakersQuery + */ +message CryptoGetStakersResponse { + /** + * Standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither + */ + ResponseHeader header = 1; + + /** + * List of accounts proxy staking to this account, and the amount each is currently proxy + * staking + */ + AllProxyStakers stakers = 3; +} diff --git a/services/CryptoService.proto b/services/crypto_service.proto similarity index 53% rename from services/CryptoService.proto rename to services/crypto_service.proto index 184fbbc3..2e035c1d 100644 --- a/services/CryptoService.proto +++ b/services/crypto_service.proto @@ -23,41 +23,86 @@ package proto; */ option java_package = "com.hederahashgraph.service.proto.java"; -import "Query.proto"; -import "Response.proto"; -import "TransactionResponse.proto"; -import "Transaction.proto"; - -/* -Transactions and queries for the Crypto Service -*/ +import "query.proto"; +import "response.proto"; +import "transaction_response.proto"; +import "transaction.proto"; + +/** + * Transactions and queries for the Crypto Service + */ service CryptoService { - // Creates a new account by submitting the transaction + /** + * Creates a new account by submitting the transaction + */ rpc createAccount (Transaction) returns (TransactionResponse); - // Updates an account by submitting the transaction + + /** + * Updates an account by submitting the transaction + */ rpc updateAccount (Transaction) returns (TransactionResponse); - // Initiates a transfer by submitting the transaction + + /** + * Initiates a transfer by submitting the transaction + */ rpc cryptoTransfer (Transaction) returns (TransactionResponse); - // Deletes and account by submitting the transaction + + /** + * Deletes and account by submitting the transaction + */ rpc cryptoDelete (Transaction) returns (TransactionResponse); - // (NOT CURRENTLY SUPPORTED) Adds a livehash + + /** + * (NOT CURRENTLY SUPPORTED) Adds a livehash + */ rpc addLiveHash (Transaction) returns (TransactionResponse); - // (NOT CURRENTLY SUPPORTED) Deletes a livehash + + /** + * (NOT CURRENTLY SUPPORTED) Deletes a livehash + */ rpc deleteLiveHash (Transaction) returns (TransactionResponse); - // (NOT CURRENTLY SUPPORTED) Retrieves a livehash for an account + + /** + * (NOT CURRENTLY SUPPORTED) Retrieves a livehash for an account + */ rpc getLiveHash (Query) returns (Response); - // Returns all transactions in the last 180s of consensus time for which the given account was the effective payer and network property ledger.keepRecordsInState was true. + + /** + * Returns all transactions in the last 180s of consensus time for which the given account was + * the effective payer and network property ledger.keepRecordsInState was + * true. + */ rpc getAccountRecords (Query) returns (Response); - // Retrieves the balance of an account + + /** + * Retrieves the balance of an account + */ rpc cryptoGetBalance (Query) returns (Response); - // Retrieves the metadata of an account + + /** + * Retrieves the metadata of an account + */ rpc getAccountInfo (Query) returns (Response); - // Retrieves the latest receipt for a transaction that is either awaiting consensus, or reached consensus in the last 180 seconds + + /** + * Retrieves the latest receipt for a transaction that is either awaiting consensus, or reached + * consensus in the last 180 seconds + */ rpc getTransactionReceipts (Query) returns (Response); - // (NOT CURRENTLY SUPPORTED) Returns the records of transactions recently funded by an account + + /** + * (NOT CURRENTLY SUPPORTED) Returns the records of transactions recently funded by an account + */ rpc getFastTransactionRecord (Query) returns (Response); - // Retrieves the record of a transaction that is either awaiting consensus, or reached consensus in the last 180 seconds + + /** + * Retrieves the record of a transaction that is either awaiting consensus, or reached consensus + * in the last 180 seconds + */ rpc getTxRecordByTxID (Query) returns (Response); - // (NOT CURRENTLY SUPPORTED) Retrieves the stakers for a node by account id + + /** + * (NOT CURRENTLY SUPPORTED) Retrieves the stakers for a node by account id + */ rpc getStakersByAccountID (Query) returns (Response); } diff --git a/services/crypto_transfer.proto b/services/crypto_transfer.proto new file mode 100644 index 00000000..0271419a --- /dev/null +++ b/services/crypto_transfer.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Transfers cryptocurrency among two or more accounts by making the desired adjustments to their + * balances. Each transfer list can specify up to 10 adjustments. Each negative amount is withdrawn + * from the corresponding account (a sender), and each positive one is added to the corresponding + * account (a receiver). The amounts list must sum to zero. Each amount is a number of tinybars + * (there are 100,000,000 tinybars in one hbar). If any sender account fails to have sufficient + * hbars, then the entire transaction fails, and none of those transfers occur, though the + * transaction fee is still charged. This transaction must be signed by the keys for all the sending + * accounts, and for any receiving accounts that have receiverSigRequired == true. The signatures + * are in the same order as the accounts, skipping those accounts that don't need a signature. + */ +message CryptoTransferTransactionBody { + /** + * The desired hbar balance adjustments + */ + TransferList transfers = 1; + + /** + * The desired token unit balance adjustments; if any custom fees are assessed, the ledger will + * try to deduct them from the payer of this CryptoTransfer, resolving the transaction to + * INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE if this is not possible + */ + repeated TokenTransferList tokenTransfers = 2; +} diff --git a/services/crypto_update.proto b/services/crypto_update.proto new file mode 100644 index 00000000..b0ea1276 --- /dev/null +++ b/services/crypto_update.proto @@ -0,0 +1,132 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +/** + * Change properties for the given account. Any null field is ignored (left unchanged). This + * transaction must be signed by the existing key for this account. If the transaction is changing + * the key field, then the transaction must be signed by both the old key (from before the change) + * and the new key. The old key must sign for security. The new key must sign as a safeguard to + * avoid accidentally changing to an invalid key, and then having no way to recover. + */ +message CryptoUpdateTransactionBody { + /** + * The account ID which is being updated in this transaction + */ + AccountID accountIDToUpdate = 2; + + /** + * The new key + */ + Key key = 3; + + /** + * ID of the account to which this account is proxy staked. If proxyAccountID is null, or is an + * invalid account, or is an account that isn't a node, then this account is automatically proxy + * staked to a node chosen by the network, but without earning payments. If the proxyAccountID + * account refuses to accept proxy staking , or if it is not currently running a node, then it + * will behave as if proxyAccountID was null. + */ + AccountID proxyAccountID = 4; + + /** + * [Deprecated]. Payments earned from proxy staking are shared between the node and this + * account, with proxyFraction / 10000 going to this account + */ + int32 proxyFraction = 5 [deprecated = true]; + + oneof sendRecordThresholdField { + /** + * [Deprecated]. The new threshold amount (in tinybars) for which an account record is + * created for any send/withdraw transaction + */ + uint64 sendRecordThreshold = 6 [deprecated = true]; + + /** + * [Deprecated]. The new threshold amount (in tinybars) for which an account record is + * created for any send/withdraw transaction + */ + google.protobuf.UInt64Value sendRecordThresholdWrapper = 11 [deprecated = true]; + + } + + oneof receiveRecordThresholdField { + /** + * [Deprecated]. The new threshold amount (in tinybars) for which an account record is + * created for any receive/deposit transaction. + */ + uint64 receiveRecordThreshold = 7 [deprecated = true]; + + /** + * [Deprecated]. The new threshold amount (in tinybars) for which an account record is + * created for any receive/deposit transaction. + */ + google.protobuf.UInt64Value receiveRecordThresholdWrapper = 12 [deprecated = true]; + } + + /** + * The duration in which it will automatically extend the expiration period. If it doesn't have + * enough balance, it extends as long as possible. If it is empty when it expires, then it is + * deleted. + */ + Duration autoRenewPeriod = 8; + + /** + * The new expiration time to extend to (ignored if equal to or before the current one) + */ + Timestamp expirationTime = 9; + + oneof receiverSigRequiredField { + /** + * [Deprecated] Do NOT use this field to set a false value because the server cannot + * distinguish from the default value. Use receiverSigRequiredWrapper field for this + * purpose. + */ + bool receiverSigRequired = 10 [deprecated = true]; + + /** + * If true, this account's key must sign any transaction depositing into this account (in + * addition to all withdrawals) + */ + google.protobuf.BoolValue receiverSigRequiredWrapper = 13; + } + + /** + * If set, the new memo to be associated with the account (UTF-8 encoding max 100 bytes) + */ + google.protobuf.StringValue memo = 14; + + /** + * The maximum number of tokens that an Account can be implicitly associated with. Up to a 1000 + * including implicit and explicit associations. + */ + google.protobuf.Int32Value max_automatic_token_associations = 15; +} diff --git a/services/custom_fees.proto b/services/custom_fees.proto new file mode 100644 index 00000000..23ce3065 --- /dev/null +++ b/services/custom_fees.proto @@ -0,0 +1,148 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * A fraction of the transferred units of a token to assess as a fee. The amount assessed will never + * be less than the given minimum_amount, and never greater than the given maximum_amount. The + * denomination is always units of the token to which this fractional fee is attached. + */ +message FractionalFee { + /** + * The fraction of the transferred units to assess as a fee + */ + Fraction fractional_amount = 1; + + /** + * The minimum amount to assess + */ + int64 minimum_amount = 2; + + /** + * The maximum amount to assess (zero implies no maximum) + */ + int64 maximum_amount = 3; + + /** + * If true, assesses the fee to the sender, so the receiver gets the full amount from the token + * transfer list, and the sender is charged an additional fee; if false, the receiver does NOT get + * the full amount, but only what is left over after paying the fractional fee + */ + bool net_of_transfers = 4; +} + +/** + * A fixed number of units (hbar or token) to assess as a fee during a CryptoTransfer that transfers + * units of the token to which this fixed fee is attached. + */ +message FixedFee { + /** + * The number of units to assess as a fee + */ + int64 amount = 1; + + /** + * The denomination of the fee; taken as hbar if left unset and, in a TokenCreate, taken as the id + * of the newly created token if set to the sentinel value of 0.0.0 + */ + TokenID denominating_token_id = 2; +} + +/** + * A fee to assess during a CryptoTransfer that changes ownership of an NFT. Defines the fraction of + * the fungible value exchanged for an NFT that the ledger should collect as a royalty. ("Fungible + * value" includes both ℏ and units of fungible HTS tokens.) When the NFT sender does not receive + * any fungible value, the ledger will assess the fallback fee, if present, to the new NFT owner. + * Royalty fees can only be added to tokens of type type NON_FUNGIBLE_UNIQUE. + */ +message RoyaltyFee { + /** + * The fraction of fungible value exchanged for an NFT to collect as royalty + */ + Fraction exchange_value_fraction = 1; + + /** + * If present, the fixed fee to assess to the NFT receiver when no fungible value is exchanged + * with the sender + */ + FixedFee fallback_fee = 2; +} + +/** + * A transfer fee to assess during a CryptoTransfer that transfers units of the token to which the + * fee is attached. A custom fee may be either fixed or fractional, and must specify a fee collector + * account to receive the assessed fees. Only positive fees may be assessed. + */ +message CustomFee { + oneof fee { + /** + * Fixed fee to be charged + */ + FixedFee fixed_fee = 1; + + /** + * Fractional fee to be charged + */ + FractionalFee fractional_fee = 2; + + /** + * Royalty fee to be charged + */ + RoyaltyFee royalty_fee = 4; + + } + /** + * The account to receive the custom fee + */ + AccountID fee_collector_account_id = 3; +} + +/** + * A custom transfer fee that was assessed during handling of a CryptoTransfer. + */ +message AssessedCustomFee { + /** + * The number of units assessed for the fee + */ + int64 amount = 1; + + /** + * The denomination of the fee; taken as hbar if left unset + */ + TokenID token_id = 2; + + /** + * The account to receive the assessed fee + */ + AccountID fee_collector_account_id = 3; + + /** + * The account(s) whose final balances would have been higher in the absence of this assessed fee + */ + repeated AccountID effective_payer_account_id = 4; +} diff --git a/services/Duration.proto b/services/duration.proto similarity index 88% rename from services/Duration.proto rename to services/duration.proto index 4d3c362c..f01f4b88 100644 --- a/services/Duration.proto +++ b/services/duration.proto @@ -25,7 +25,12 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -/* A length of time in seconds. */ +/** + * A length of time in seconds. + */ message Duration { - int64 seconds = 1; // The number of seconds + /** + * The number of seconds + */ + int64 seconds = 1; } diff --git a/services/ExchangeRate.proto b/services/exchange_rate.proto similarity index 64% rename from services/ExchangeRate.proto rename to services/exchange_rate.proto index 28c617c5..1a7b9cc5 100644 --- a/services/ExchangeRate.proto +++ b/services/exchange_rate.proto @@ -24,24 +24,41 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "Timestamp.proto"; +import "timestamp.proto"; -/* -An exchange rate between hbar and cents (USD) and the time at which the exchange rate will expire, and be superseded by a new exchange rate. -*/ +/** + * An exchange rate between hbar and cents (USD) and the time at which the exchange rate will + * expire, and be superseded by a new exchange rate. + */ message ExchangeRate { - // Denominator in calculation of exchange rate between hbar and cents + /** + * Denominator in calculation of exchange rate between hbar and cents + */ int32 hbarEquiv = 1; - // Numerator in calculation of exchange rate between hbar and cents + + /** + * Numerator in calculation of exchange rate between hbar and cents + */ int32 centEquiv = 2; - // Expiration time in seconds for this exchange rate + + /** + * Expiration time in seconds for this exchange rate + */ TimestampSeconds expirationTime = 3; } -/* Two sets of exchange rates */ + +/** + * Two sets of exchange rates + */ message ExchangeRateSet { - // Current exchange rate + /** + * Current exchange rate + */ ExchangeRate currentRate = 1; - // Next exchange rate which will take effect when current rate expires + + /** + * Next exchange rate which will take effect when current rate expires + */ ExchangeRate nextRate = 2; } diff --git a/services/FileAppend.proto b/services/file_append.proto similarity index 57% rename from services/FileAppend.proto rename to services/file_append.proto index 425997f7..dc3206c4 100644 --- a/services/FileAppend.proto +++ b/services/file_append.proto @@ -26,14 +26,23 @@ option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "BasicTypes.proto"; +import "basic_types.proto"; -/* -Append the given contents to the end of the specified file. If a file is too big to create with a single FileCreateTransaction, then it can be created with the first part of its contents, and then appended as many times as necessary to create the entire file. This transaction must be signed by all initial M-of-M KeyList keys. If keys contains additional KeyList or ThresholdKey then M-of-M secondary KeyList or ThresholdKey signing requirements must be meet. -*/ +/** + * Append the given contents to the end of the specified file. If a file is too big to create with a + * single FileCreateTransaction, then it can be created with the first part of its contents, and + * then appended as many times as necessary to create the entire file. This transaction must be + * signed by all initial M-of-M KeyList keys. If keys contains additional KeyList or ThresholdKey + * then M-of-M secondary KeyList or ThresholdKey signing requirements must be meet. + */ message FileAppendTransactionBody { - // The file to which the bytes will be appended + /** + * The file to which the bytes will be appended + */ FileID fileID = 2; - // The bytes that will be appended to the end of the specified file + + /** + * The bytes that will be appended to the end of the specified file + */ bytes contents = 4; } diff --git a/services/file_create.proto b/services/file_create.proto new file mode 100644 index 00000000..e3abf183 --- /dev/null +++ b/services/file_create.proto @@ -0,0 +1,102 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "timestamp.proto"; + +/** + * Create a new file, containing the given contents. + * After the file is created, the FileID for it can be found in the receipt, or record, or retrieved + * with a GetByKey query. + * + * The file contains the specified contents (possibly empty). The file will automatically disappear + * at the expirationTime, unless its expiration is extended by another transaction before that time. + * If the file is deleted, then its contents will become empty and it will be marked as deleted + * until it expires, and then it will cease to exist. + * + * The keys field is a list of keys. All keys within the top-level key list must sign (M-M) to + * create or modify a file. However, to delete the file, only one key (1-M) is required to sign from + * the top-level key list. Each of those "keys" may itself be threshold key containing other keys + * (including other threshold keys). In other words, the behavior is an AND for create/modify, OR + * for delete. This is useful for acting as a revocation server. If it is desired to have the + * behavior be AND for all 3 operations (or OR for all 3), then the list should have only a single + * Key, which is a threshold key, with N=1 for OR, N=M for AND. + * + * If a file is created without ANY keys in the keys field, the file is immutable and ONLY the + * expirationTime of the file can be changed with a FileUpdate transaction. The file contents or its + * keys cannot be changed. + * + * An entity (account, file, or smart contract instance) must be created in a particular realm. If + * the realmID is left null, then a new realm will be created with the given admin key. If a new + * realm has a null adminKey, then anyone can create/modify/delete entities in that realm. But if an + * admin key is given, then any transaction to create/modify/delete an entity in that realm must be + * signed by that key, though anyone can still call functions on smart contract instances that exist + * in that realm. A realm ceases to exist when everything within it has expired and no longer + * exists. + * + * The current API ignores shardID, realmID, and newRealmAdminKey, and creates everything in shard 0 + * and realm 0, with a null key. Future versions of the API will support multiple realms and + * multiple shards. + */ +message FileCreateTransactionBody { + /** + * The time at which this file should expire (unless FileUpdateTransaction is used before then + * to extend its life) + */ + Timestamp expirationTime = 2; + + /** + * All keys at the top level of a key list must sign to create or modify the file. Any one of + * the keys at the top level key list can sign to delete the file. + */ + KeyList keys = 3; + + /** + * The bytes that are the contents of the file + */ + bytes contents = 4; + + /** + * Shard in which this file is created + */ + ShardID shardID = 5; + + /** + * The Realm in which to the file is created (leave this null to create a new realm) + */ + RealmID realmID = 6; + + /** + * If realmID is null, then this the admin key for the new realm that will be created + */ + Key newRealmAdminKey = 7; + + /** + * The memo associated with the file (UTF-8 encoding max 100 bytes) + */ + string memo = 8; +} diff --git a/services/FileDelete.proto b/services/file_delete.proto similarity index 52% rename from services/FileDelete.proto rename to services/file_delete.proto index eb7e4ee6..5d9a3126 100644 --- a/services/FileDelete.proto +++ b/services/file_delete.proto @@ -25,9 +25,19 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "BasicTypes.proto"; +import "basic_types.proto"; -/* Delete the given file. After deletion, it will be marked as deleted and will have no contents. But information about it will continue to exist until it expires. A list of keys was given when the file was created. All the top level keys on that list must sign transactions to create or modify the file, but any single one of the top level keys can be used to delete the file. This transaction must be signed by 1-of-M KeyList keys. If keys contains additional KeyList or ThresholdKey then 1-of-M secondary KeyList or ThresholdKey signing requirements must be meet. */ +/** + * Delete the given file. After deletion, it will be marked as deleted and will have no contents. + * But information about it will continue to exist until it expires. A list of keys was given when + * the file was created. All the top level keys on that list must sign transactions to create or + * modify the file, but any single one of the top level keys can be used to delete the file. This + * transaction must be signed by 1-of-M KeyList keys. If keys contains additional KeyList or + * ThresholdKey then 1-of-M secondary KeyList or ThresholdKey signing requirements must be meet. + */ message FileDeleteTransactionBody { - FileID fileID = 2; // The file to delete. It will be marked as deleted until it expires. Then it will disappear. + /** + * The file to delete. It will be marked as deleted until it expires. Then it will disappear. + */ + FileID fileID = 2; } diff --git a/services/file_get_contents.proto b/services/file_get_contents.proto new file mode 100644 index 00000000..fc6e9a1a --- /dev/null +++ b/services/file_get_contents.proto @@ -0,0 +1,76 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "query_header.proto"; +import "response_header.proto"; + +/** + * Get the contents of a file. The content field is empty (no bytes) if the file is empty. + */ +message FileGetContentsQuery { + /** + * Standard info sent from client to node, including the signed payment, and what kind of + * response is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + /** + * The file ID of the file whose contents are requested + */ + FileID fileID = 2; +} + +/** + * Response when the client sends the node FileGetContentsQuery + */ +message FileGetContentsResponse { + /** + * Standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither + */ + ResponseHeader header = 1; + + message FileContents { + /** + * The file ID of the file whose contents are being returned + */ + FileID fileID = 1; + + /** + * The bytes contained in the file + */ + bytes contents = 2; + } + + /** + * the file ID and contents (a state proof can be generated for this) + */ + FileContents fileContents = 2; +} + + diff --git a/services/file_get_info.proto b/services/file_get_info.proto new file mode 100644 index 00000000..666f1ecb --- /dev/null +++ b/services/file_get_info.proto @@ -0,0 +1,100 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "timestamp.proto"; +import "basic_types.proto"; +import "query_header.proto"; +import "response_header.proto"; + +/** + * Get all of the information about a file, except for its contents. When a file expires, it no + * longer exists, and there will be no info about it, and the fileInfo field will be blank. If a + * transaction or smart contract deletes the file, but it has not yet expired, then the fileInfo + * field will be non-empty, the deleted field will be true, its size will be 0, and its contents + * will be empty. + */ +message FileGetInfoQuery { + /** + * Standard info sent from client to node, including the signed payment, and what kind of + * response is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + /** + * The file ID of the file for which information is requested + */ + FileID fileID = 2; +} + +/** + * Response when the client sends the node FileGetInfoQuery + */ +message FileGetInfoResponse { + /** + * Standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither + */ + ResponseHeader header = 1; + + + message FileInfo { + /** + * The file ID of the file for which information is requested + */ + FileID fileID = 1; + + /** + * Number of bytes in contents + */ + int64 size = 2; + + /** + * The current time at which this account is set to expire + */ + Timestamp expirationTime = 3; + + /** + * True if deleted but not yet expired + */ + bool deleted = 4; + + /** + * One of these keys must sign in order to modify or delete the file + */ + KeyList keys = 5; + + /** + * The memo associated with the file + */ + string memo = 6; + } + + /** + * The information about the file + */ + FileInfo fileInfo = 2; +} diff --git a/services/FileService.proto b/services/file_service.proto similarity index 68% rename from services/FileService.proto rename to services/file_service.proto index a1470d15..9e9a949b 100644 --- a/services/FileService.proto +++ b/services/file_service.proto @@ -23,29 +23,52 @@ package proto; */ option java_package = "com.hederahashgraph.service.proto.java"; -import "Query.proto"; -import "Response.proto"; -import "TransactionResponse.proto"; -import "Transaction.proto"; - -/* -Transactions and queries for the file service. -*/ +import "query.proto"; +import "response.proto"; +import "transaction_response.proto"; +import "transaction.proto"; + +/** + * Transactions and queries for the file service. + */ service FileService { - // Creates a file + /** + * Creates a file + */ rpc createFile (Transaction) returns (TransactionResponse); - // Updates a file + + /** + * Updates a file + */ rpc updateFile (Transaction) returns (TransactionResponse); - // Deletes a file + + /** + * Deletes a file + */ rpc deleteFile (Transaction) returns (TransactionResponse); - // Appends to a file + + /** + * Appends to a file + */ rpc appendContent (Transaction) returns (TransactionResponse); - // Retrieves the file contents + + /** + * Retrieves the file contents + */ rpc getFileContent (Query) returns (Response); - // Retrieves the file information + + /** + * Retrieves the file information + */ rpc getFileInfo (Query) returns (Response); - // Deletes a file if the submitting account has network admin privileges + + /** + * Deletes a file if the submitting account has network admin privileges + */ rpc systemDelete (Transaction) returns (TransactionResponse); - // Undeletes a file if the submitting account has network admin privileges + + /** + * Undeletes a file if the submitting account has network admin privileges + */ rpc systemUndelete (Transaction) returns (TransactionResponse); } diff --git a/services/file_update.proto b/services/file_update.proto new file mode 100644 index 00000000..411e143d --- /dev/null +++ b/services/file_update.proto @@ -0,0 +1,65 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +/** + * Modify the metadata and/or contents of a file. If a field is not set in the transaction body, the + * corresponding file attribute will be unchanged. This transaction must be signed by all the keys + * in the top level of a key list (M-of-M) of the file being updated. If the keys themselves are + * being updated, then the transaction must also be signed by all the new keys. If the keys contain + * additional KeyList or ThresholdKey then M-of-M secondary KeyList or ThresholdKey signing + * requirements must be meet + */ +message FileUpdateTransactionBody { + /** + * The ID of the file to update + */ + FileID fileID = 1; + + /** + * The new expiry time (ignored if not later than the current expiry) + */ + Timestamp expirationTime = 2; + + /** + * The new list of keys that can modify or delete the file + */ + KeyList keys = 3; + + /** + * The new contents that should overwrite the file's current contents + */ + bytes contents = 4; + + /** + * If set, the new memo to be associated with the file (UTF-8 encoding max 100 bytes) + */ + google.protobuf.StringValue memo = 5; +} diff --git a/services/freeze.proto b/services/freeze.proto new file mode 100644 index 00000000..8b6b0733 --- /dev/null +++ b/services/freeze.proto @@ -0,0 +1,82 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "duration.proto"; +import "timestamp.proto"; +import "basic_types.proto"; +import "freeze_type.proto"; + +/** + * At consensus, sets the consensus time at which the platform should stop creating events and + * accepting transactions, and enter a maintenance window. + */ +message FreezeTransactionBody { + /** + * !! DEPRECATED and REJECTED by nodes + * The start hour (in UTC time), a value between 0 and 23 + */ + int32 startHour = 1 [deprecated=true]; + + /** + * !! DEPRECATED and REJECTED by nodes + * The start minute (in UTC time), a value between 0 and 59 + */ + int32 startMin = 2 [deprecated=true]; + + /** + * !! DEPRECATED and REJECTED by nodes + * The end hour (in UTC time), a value between 0 and 23 + */ + int32 endHour = 3 [deprecated=true]; + + /** + * !! DEPRECATED and REJECTED by nodes + * The end minute (in UTC time), a value between 0 and 59 + */ + int32 endMin = 4 [deprecated=true]; + + /** + * If set, the file whose contents should be used for a network software update during the + * maintenance window. + */ + FileID update_file = 5; + + /** + * If set, the expected hash of the contents of the update file (used to verify the update). + */ + bytes file_hash = 6; + + /** + * The consensus time at which the maintenance window should begin. + */ + Timestamp start_time = 7; + + /** + * The type of network freeze or upgrade operation to perform. + */ + FreezeType freeze_type = 8; +} diff --git a/services/FreezeService.proto b/services/freeze_service.proto similarity index 72% rename from services/FreezeService.proto rename to services/freeze_service.proto index 491d51d5..c322444a 100644 --- a/services/FreezeService.proto +++ b/services/freeze_service.proto @@ -23,11 +23,16 @@ package proto; */ option java_package = "com.hederahashgraph.service.proto.java"; -import "TransactionResponse.proto"; -import "Transaction.proto"; +import "transaction_response.proto"; +import "transaction.proto"; -/* The request and responses for freeze service. */ +/** + * The request and responses for freeze service. + */ service FreezeService { - - rpc freeze (Transaction) returns (TransactionResponse); // Freezes the nodes by submitting the transaction. The grpc server returns the TransactionResponse + /** + * Freezes the nodes by submitting the transaction. The grpc server returns the + * TransactionResponse + */ + rpc freeze (Transaction) returns (TransactionResponse); } diff --git a/services/freeze_type.proto b/services/freeze_type.proto new file mode 100644 index 00000000..6f124444 --- /dev/null +++ b/services/freeze_type.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +/** +* The type of network freeze or upgrade operation to be performed. This type dictates which +* fields are required. +*/ +enum FreezeType { + /** + * An (invalid) default value for this enum, to ensure the client explicitly sets + * the intended type of freeze transaction. + */ + UNKNOWN_FREEZE_TYPE = 0; + + /** + * Freezes the network at the specified time. The start_time field must be provided and + * must reference a future time. Any values specified for the update_file and file_hash + * fields will be ignored. This transaction does not perform any network changes or + * upgrades and requires manual intervention to restart the network. + */ + FREEZE_ONLY = 1; + + /** + * A non-freezing operation that initiates network wide preparation in advance of a + * scheduled freeze upgrade. The update_file and file_hash fields must be provided and + * valid. The start_time field may be omitted and any value present will be ignored. + */ + PREPARE_UPGRADE = 2; + + /** + * Freezes the network at the specified time and performs the previously prepared + * automatic upgrade across the entire network. + */ + FREEZE_UPGRADE = 3; + + /** + * Aborts a pending network freeze operation. + */ + FREEZE_ABORT = 4; + + /** + * Performs an immediate upgrade on auxilary services and containers providing + * telemetry/metrics. Does not impact network operations. + */ + TELEMETRY_UPGRADE = 5; +} diff --git a/services/get_by_key.proto b/services/get_by_key.proto new file mode 100644 index 00000000..93aee4f3 --- /dev/null +++ b/services/get_by_key.proto @@ -0,0 +1,93 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "query_header.proto"; +import "response_header.proto"; +import "crypto_add_live_hash.proto"; + +/** + * Get all accounts, claims, files, and smart contract instances whose associated keys include the + * given Key. The given Key must not be a contractID or a ThresholdKey. This is not yet implemented + * in the API, but will be in the future. + */ +message GetByKeyQuery { + /** + * Standard info sent from client to node, including the signed payment, and what kind of + * response is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + /** + * The key to search for. It must not contain a contractID nor a ThresholdSignature. + */ + Key key = 2; +} + +/** + * the ID for a single entity (account, livehash, file, or smart contract instance) + */ +message EntityID { + oneof entity { + /** + * The Account ID for the cryptocurrency account + */ + AccountID accountID = 1; + + /** + * A uniquely identifying livehash of an acount + */ + LiveHash liveHash = 2; + + /** + * The file ID of the file + */ + FileID fileID = 3; + + /** + * The smart contract ID that identifies instance + */ + ContractID contractID = 4; + + } +} + +/** + * Response when the client sends the node GetByKeyQuery + */ +message GetByKeyResponse { + /** + * Standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither + */ + ResponseHeader header = 1; + + /** + * The list of entities that include this public key in their associated Key list + */ + repeated EntityID entities = 2; +} diff --git a/services/get_by_solidity_id.proto b/services/get_by_solidity_id.proto new file mode 100644 index 00000000..a86382ce --- /dev/null +++ b/services/get_by_solidity_id.proto @@ -0,0 +1,75 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "query_header.proto"; +import "response_header.proto"; + +/** + * Get the IDs in the format used by transactions, given the ID in the format used by Solidity. If + * the Solidity ID is for a smart contract instance, then both the ContractID and associated + * AccountID will be returned. + */ +message GetBySolidityIDQuery { + /** + * Standard info sent from client to node, including the signed payment, and what kind of + * response is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + /** + * The ID in the format used by Solidity + */ + string solidityID = 2; +} + +/** + * Response when the client sends the node GetBySolidityIDQuery + */ +message GetBySolidityIDResponse { + /** + * Standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither + */ + ResponseHeader header = 1; + + /** + * The Account ID for the cryptocurrency account + */ + AccountID accountID = 2; + + /** + * The file Id for the file + */ + FileID fileID = 3; + + /** + * A smart contract ID for the instance (if this is included, then the associated accountID will + * also be included) + */ + ContractID contractID = 4; +} diff --git a/services/network_get_execution_time.proto b/services/network_get_execution_time.proto new file mode 100644 index 00000000..a6f9061e --- /dev/null +++ b/services/network_get_execution_time.proto @@ -0,0 +1,67 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "query_header.proto"; +import "response_header.proto"; + +/** + * Gets the time in nanoseconds spent in handleTransaction for one or more + * TransactionIDs (assuming they have reached consensus "recently", since only a limited + * number of execution times are kept in-memory, depending on the value of the node-local + * property stats.executionTimesToTrack). + */ +message NetworkGetExecutionTimeQuery { + /** + * standard info sent from client to node including the signed payment, and what kind of response + * is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + /** + * The id(s) of the transactions to get the execution time(s) of + */ + repeated TransactionID transaction_ids = 2; +} + +/** + * Response when the client sends the node NetworkGetExecutionTimeQuery; returns + * INVALID_TRANSACTION_ID if any of the given TransactionIDs do not have available + * execution times in the answering node. + */ +message NetworkGetExecutionTimeResponse { + /** + * Standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither + */ + ResponseHeader header = 1; + + /** + * The execution time(s) of the requested TransactionIDs, if available + */ + repeated uint64 execution_times = 2; +} diff --git a/services/network_get_version_info.proto b/services/network_get_version_info.proto new file mode 100644 index 00000000..3e7b9e86 --- /dev/null +++ b/services/network_get_version_info.proto @@ -0,0 +1,62 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "query_header.proto"; +import "response_header.proto"; + +/** + * Get the deployed versions of Hedera Services and the HAPI proto in semantic version format + */ +message NetworkGetVersionInfoQuery { + /** + * Standard info sent from client to node, including the signed payment, and what kind of + * response is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; +} + +/** + * Response when the client sends the node NetworkGetVersionInfoQuery + */ +message NetworkGetVersionInfoResponse { + /** + * Standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither + */ + ResponseHeader header = 1; + + /** + * The Hedera API (HAPI) protobuf version recognized by the responding node. + */ + SemanticVersion hapiProtoVersion = 2; + + /** + * The version of the Hedera Services software deployed on the responding node. + */ + SemanticVersion hederaServicesVersion = 3; +} diff --git a/services/network_service.proto b/services/network_service.proto new file mode 100644 index 00000000..aab60e5b --- /dev/null +++ b/services/network_service.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.service.proto.java"; + +import "query.proto"; +import "response.proto"; +import "transaction_response.proto"; +import "transaction.proto"; + +/** + * The requests and responses for different network services. + */ +service NetworkService { + /** + * Retrieves the active versions of Hedera Services and HAPI proto + */ + rpc getVersionInfo (Query) returns (Response); + + /** + * Retrieves the time in nanoseconds spent in handleTransaction for one or more + * TransactionIDs (assuming they have reached consensus "recently", since only a limited + * number of execution times are kept in-memory, depending on the value of the node-local + * property stats.executionTimesToTrack). + */ + rpc getExecutionTime (Query) returns (Response); + + /** + * Submits a "wrapped" transaction to the network, skipping its standard prechecks. (Note that + * the "wrapper" UncheckedSubmit transaction is still subject to normal prechecks, + * including an authorization requirement that its payer be either the treasury or system admin + * account.) + */ + rpc uncheckedSubmit (Transaction) returns (TransactionResponse); +} diff --git a/services/query.proto b/services/query.proto new file mode 100644 index 00000000..c4f027fd --- /dev/null +++ b/services/query.proto @@ -0,0 +1,193 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "get_by_key.proto"; +import "get_by_solidity_id.proto"; + +import "contract_call_local.proto"; +import "contract_get_info.proto"; +import "contract_get_bytecode.proto"; +import "contract_get_records.proto"; + +import "crypto_get_account_balance.proto"; +import "crypto_get_account_records.proto"; +import "crypto_get_info.proto"; +import "crypto_get_live_hash.proto"; +import "crypto_get_stakers.proto"; + +import "file_get_contents.proto"; +import "file_get_info.proto"; + +import "transaction_get_receipt.proto"; +import "transaction_get_record.proto"; +import "transaction_get_fast_record.proto"; + +import "consensus_get_topic_info.proto"; + +import "network_get_version_info.proto"; +import "network_get_execution_time.proto"; + +import "token_get_info.proto"; +import "schedule_get_info.proto"; + +import "token_get_account_nft_infos.proto"; +import "token_get_nft_info.proto"; +import "token_get_nft_infos.proto"; + +/** + * A single query, which is sent from the client to a node. This includes all possible queries. Each + * Query should not have more than 50 levels. + */ +message Query { + oneof query { + /** + * Get all entities associated with a given key + */ + GetByKeyQuery getByKey = 1; + + /** + * Get the IDs in the format used in transactions, given the format used in Solidity + */ + GetBySolidityIDQuery getBySolidityID = 2; + + /** + * Call a function of a smart contract instance + */ + ContractCallLocalQuery contractCallLocal = 3; + + /** + * Get information about a smart contract instance + */ + ContractGetInfoQuery contractGetInfo = 4; + + /** + * Get bytecode used by a smart contract instance + */ + ContractGetBytecodeQuery contractGetBytecode = 5; + + /** + * Get Records of the contract instance + */ + ContractGetRecordsQuery ContractGetRecords = 6; + + + /** + * Get the current balance in a cryptocurrency account + */ + CryptoGetAccountBalanceQuery cryptogetAccountBalance = 7; + + /** + * Get all the records that currently exist for transactions involving an account + */ + CryptoGetAccountRecordsQuery cryptoGetAccountRecords = 8; + + /** + * Get all information about an account + */ + CryptoGetInfoQuery cryptoGetInfo = 9; + + /** + * Get a single livehash from a single account, if present + */ + CryptoGetLiveHashQuery cryptoGetLiveHash = 10; + + /** + * Get all the accounts that proxy stake to a given account, and how much they proxy stake + * (not yet implemented in the current API) + */ + CryptoGetStakersQuery cryptoGetProxyStakers = 11; + + /** + * Get the contents of a file (the bytes stored in it) + */ + FileGetContentsQuery fileGetContents = 12; + + /** + * Get information about a file, such as its expiration date + */ + FileGetInfoQuery fileGetInfo = 13; + + /** + * Get a receipt for a transaction (lasts 180 seconds) + */ + TransactionGetReceiptQuery transactionGetReceipt = 14; + + /** + * Get a record for a transaction + */ + TransactionGetRecordQuery transactionGetRecord = 15; + + /** + * Get a record for a transaction (lasts 180 seconds) + */ + TransactionGetFastRecordQuery transactionGetFastRecord = 16; + + /** + * Get the parameters of and state of a consensus topic. + */ + ConsensusGetTopicInfoQuery consensusGetTopicInfo = 50; + + /** + * Get the versions of the HAPI protobuf and Hedera Services software deployed on the + * responding node. + */ + NetworkGetVersionInfoQuery networkGetVersionInfo = 51; + + + /** + * Get all information about a token + */ + TokenGetInfoQuery tokenGetInfo = 52; + + + /** + * Get all information about a scheduled entity + */ + ScheduleGetInfoQuery scheduleGetInfo = 53; + + + /** + * Get a list of NFTs associated with the account + */ + TokenGetAccountNftInfosQuery tokenGetAccountNftInfos = 54; + + /** + * Get all information about a NFT + */ + TokenGetNftInfoQuery tokenGetNftInfo = 55; + + /** + * Get a list of NFTs for the token + */ + TokenGetNftInfosQuery tokenGetNftInfos = 56; + + /** + * Gets handleTransaction times for one or more "sufficiently recent" TransactionIDs + */ + NetworkGetExecutionTimeQuery networkGetExecutionTime = 57; + } +} diff --git a/services/query_header.proto b/services/query_header.proto new file mode 100644 index 00000000..849b1c07 --- /dev/null +++ b/services/query_header.proto @@ -0,0 +1,75 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "transaction.proto"; + +/** + * The client uses the ResponseType to indicate that it desires the node send just the answer, or + * both the answer and a state proof. It can also ask for just the cost and not the answer itself + * (allowing it to tailor the payment transaction accordingly). If the payment in the query fails + * the precheck, then the response may have some fields blank. The state proof is only available for + * some types of information. It is available for a Record, but not a receipt. It is available for + * the information in each kind of *GetInfo request. + */ +enum ResponseType { + /** + * Response returns answer + */ + ANSWER_ONLY = 0; + + /** + * (NOT YET SUPPORTED) Response returns both answer and state proof + */ + ANSWER_STATE_PROOF = 1; + + /** + * Response returns the cost of answer + */ + COST_ANSWER = 2; + + /** + * (NOT YET SUPPORTED) Response returns the total cost of answer and state proof + */ + COST_ANSWER_STATE_PROOF = 3; +} + +/** + * Each query from the client to the node will contain the QueryHeader, which gives the requested + * response type, and includes a payment transaction that will compensate the node for responding to + * the query. The payment can be blank if the query is free. + */ +message QueryHeader { + /** + * A signed CryptoTransferTransaction to pay the node a fee for handling this query + */ + Transaction payment = 1; + + /** + * The requested response, asking for cost, state proof, both, or neither + */ + ResponseType responseType = 2; +} diff --git a/services/response.proto b/services/response.proto new file mode 100644 index 00000000..f65d0b6a --- /dev/null +++ b/services/response.proto @@ -0,0 +1,188 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "get_by_key.proto"; +import "get_by_solidity_id.proto"; + +import "contract_call_local.proto"; +import "contract_get_bytecode.proto"; +import "contract_get_info.proto"; +import "contract_get_records.proto"; + +import "crypto_get_account_balance.proto"; +import "crypto_get_account_records.proto"; +import "crypto_get_info.proto"; +import "crypto_get_live_hash.proto"; +import "crypto_get_stakers.proto"; + +import "file_get_contents.proto"; +import "file_get_info.proto"; + +import "transaction_get_receipt.proto"; +import "transaction_get_record.proto"; +import "transaction_get_fast_record.proto"; + +import "consensus_get_topic_info.proto"; + +import "network_get_version_info.proto"; +import "network_get_execution_time.proto"; + +import "token_get_account_nft_infos.proto"; +import "token_get_info.proto"; +import "token_get_nft_info.proto"; +import "token_get_nft_infos.proto"; + +import "schedule_get_info.proto"; + + +/** + * A single response, which is returned from the node to the client, after the client sent the node + * a query. This includes all responses. + */ +message Response { + oneof response { + /** + * Get all entities associated with a given key + */ + GetByKeyResponse getByKey = 1; + + /** + * Get the IDs in the format used in transactions, given the format used in Solidity + */ + GetBySolidityIDResponse getBySolidityID = 2; + + /** + * Response to call a function of a smart contract instance + */ + ContractCallLocalResponse contractCallLocal = 3; + + /** + * Get the bytecode for a smart contract instance + */ + ContractGetBytecodeResponse contractGetBytecodeResponse = 5; + + /** + * Get information about a smart contract instance + */ + ContractGetInfoResponse contractGetInfo = 4; + + /** + * Get all existing records for a smart contract instance + */ + ContractGetRecordsResponse contractGetRecordsResponse = 6; + + /** + * Get the current balance in a cryptocurrency account + */ + CryptoGetAccountBalanceResponse cryptogetAccountBalance = 7; + + /** + * Get all the records that currently exist for transactions involving an account + */ + CryptoGetAccountRecordsResponse cryptoGetAccountRecords = 8; + + /** + * Get all information about an account + */ + CryptoGetInfoResponse cryptoGetInfo = 9; + + /** + * Contains a livehash associated to an account + */ + CryptoGetLiveHashResponse cryptoGetLiveHash = 10; + + /** + * Get all the accounts that proxy stake to a given account, and how much they proxy stake + */ + CryptoGetStakersResponse cryptoGetProxyStakers = 11; + + /** + * Get the contents of a file (the bytes stored in it) + */ + FileGetContentsResponse fileGetContents = 12; + + /** + * Get information about a file, such as its expiration date + */ + FileGetInfoResponse fileGetInfo = 13; + + /** + * Get a receipt for a transaction + */ + TransactionGetReceiptResponse transactionGetReceipt = 14; + + /** + * Get a record for a transaction + */ + TransactionGetRecordResponse transactionGetRecord = 15; + + /** + * Get a record for a transaction (lasts 180 seconds) + */ + TransactionGetFastRecordResponse transactionGetFastRecord = 16; + + /** + * Parameters of and state of a consensus topic.. + */ + ConsensusGetTopicInfoResponse consensusGetTopicInfo = 150; + + /** + * Semantic versions of Hedera Services and HAPI proto + */ + NetworkGetVersionInfoResponse networkGetVersionInfo = 151; + + /** + * Get all information about a token + */ + TokenGetInfoResponse tokenGetInfo = 152; + + /** + * Get all information about a schedule entity + */ + ScheduleGetInfoResponse scheduleGetInfo = 153; + + /** + * A list of the NFTs associated with the account + */ + TokenGetAccountNftInfosResponse tokenGetAccountNftInfos = 154; + + /** + * All information about an NFT + */ + TokenGetNftInfoResponse tokenGetNftInfo = 155; + + /** + * A list of the NFTs for the token + */ + TokenGetNftInfosResponse tokenGetNftInfos = 156; + + /** + * Execution times of "sufficiently recent" transactions + */ + NetworkGetExecutionTimeResponse networkGetExecutionTime = 157; + } +} diff --git a/services/response_code.proto b/services/response_code.proto new file mode 100644 index 00000000..f5de8371 --- /dev/null +++ b/services/response_code.proto @@ -0,0 +1,1113 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +/** + * UNDOCUMENTED + */ +enum ResponseCodeEnum { + /** + * The transaction passed the precheck validations. + */ + OK = 0; + + /** + * For any error not handled by specific error codes listed below. + */ + INVALID_TRANSACTION = 1; + + /** + * Payer account does not exist. + */ + PAYER_ACCOUNT_NOT_FOUND = 2; + + /** + * Node Account provided does not match the node account of the node the transaction was submitted + * to. + */ + INVALID_NODE_ACCOUNT = 3; + + /** + * Pre-Check error when TransactionValidStart + transactionValidDuration is less than current + * consensus time. + */ + TRANSACTION_EXPIRED = 4; + + /** + * Transaction start time is greater than current consensus time + */ + INVALID_TRANSACTION_START = 5; + + /** + * The given transactionValidDuration was either non-positive, or greater than the maximum + * valid duration of 180 secs. + * + */ + INVALID_TRANSACTION_DURATION = 6; + + /** + * The transaction signature is not valid + */ + INVALID_SIGNATURE = 7; + + /** + * Transaction memo size exceeded 100 bytes + */ + MEMO_TOO_LONG = 8; + + /** + * The fee provided in the transaction is insufficient for this type of transaction + */ + INSUFFICIENT_TX_FEE = 9; + + /** + * The payer account has insufficient cryptocurrency to pay the transaction fee + */ + INSUFFICIENT_PAYER_BALANCE = 10; + + /** + * This transaction ID is a duplicate of one that was submitted to this node or reached consensus + * in the last 180 seconds (receipt period) + */ + DUPLICATE_TRANSACTION = 11; + + /** + * If API is throttled out + */ + BUSY = 12; + + /** + * The API is not currently supported + */ + NOT_SUPPORTED = 13; + + /** + * The file id is invalid or does not exist + */ + INVALID_FILE_ID = 14; + + /** + * The account id is invalid or does not exist + */ + INVALID_ACCOUNT_ID = 15; + + /** + * The contract id is invalid or does not exist + */ + INVALID_CONTRACT_ID = 16; + + /** + * Transaction id is not valid + */ + INVALID_TRANSACTION_ID = 17; + + /** + * Receipt for given transaction id does not exist + */ + RECEIPT_NOT_FOUND = 18; + + /** + * Record for given transaction id does not exist + */ + RECORD_NOT_FOUND = 19; + + /** + * The solidity id is invalid or entity with this solidity id does not exist + */ + INVALID_SOLIDITY_ID = 20; + + /** + * The responding node has submitted the transaction to the network. Its final status is still + * unknown. + */ + UNKNOWN = 21; + + /** + * The transaction succeeded + */ + SUCCESS = 22; + + /** + * There was a system error and the transaction failed because of invalid request parameters. + */ + FAIL_INVALID = 23; + + /** + * There was a system error while performing fee calculation, reserved for future. + */ + FAIL_FEE = 24; + + /** + * There was a system error while performing balance checks, reserved for future. + */ + FAIL_BALANCE = 25; + + /** + * Key not provided in the transaction body + */ + KEY_REQUIRED = 26; + + /** + * Unsupported algorithm/encoding used for keys in the transaction + */ + BAD_ENCODING = 27; + + /** + * When the account balance is not sufficient for the transfer + */ + INSUFFICIENT_ACCOUNT_BALANCE = 28; + + /** + * During an update transaction when the system is not able to find the Users Solidity address + */ + INVALID_SOLIDITY_ADDRESS = 29; + + /** + * Not enough gas was supplied to execute transaction + */ + INSUFFICIENT_GAS = 30; + + /** + * contract byte code size is over the limit + */ + CONTRACT_SIZE_LIMIT_EXCEEDED = 31; + + /** + * local execution (query) is requested for a function which changes state + */ + LOCAL_CALL_MODIFICATION_EXCEPTION = 32; + + /** + * Contract REVERT OPCODE executed + */ + CONTRACT_REVERT_EXECUTED = 33; + + /** + * For any contract execution related error not handled by specific error codes listed above. + */ + CONTRACT_EXECUTION_EXCEPTION = 34; + + /** + * In Query validation, account with +ve(amount) value should be Receiving node account, the + * receiver account should be only one account in the list + */ + INVALID_RECEIVING_NODE_ACCOUNT = 35; + + /** + * Header is missing in Query request + */ + MISSING_QUERY_HEADER = 36; + + /** + * The update of the account failed + */ + ACCOUNT_UPDATE_FAILED = 37; + + /** + * Provided key encoding was not supported by the system + */ + INVALID_KEY_ENCODING = 38; + + /** + * null solidity address + */ + NULL_SOLIDITY_ADDRESS = 39; + + /** + * update of the contract failed + */ + CONTRACT_UPDATE_FAILED = 40; + + /** + * the query header is invalid + */ + INVALID_QUERY_HEADER = 41; + + /** + * Invalid fee submitted + */ + INVALID_FEE_SUBMITTED = 42; + + /** + * Payer signature is invalid + */ + INVALID_PAYER_SIGNATURE = 43; + + /** + * The keys were not provided in the request. + */ + KEY_NOT_PROVIDED = 44; + + /** + * Expiration time provided in the transaction was invalid. + */ + INVALID_EXPIRATION_TIME = 45; + + /** + * WriteAccess Control Keys are not provided for the file + */ + NO_WACL_KEY = 46; + + /** + * The contents of file are provided as empty. + */ + FILE_CONTENT_EMPTY = 47; + + /** + * The crypto transfer credit and debit do not sum equal to 0 + */ + INVALID_ACCOUNT_AMOUNTS = 48; + + /** + * Transaction body provided is empty + */ + EMPTY_TRANSACTION_BODY = 49; + + /** + * Invalid transaction body provided + */ + INVALID_TRANSACTION_BODY = 50; + + /** + * the type of key (base ed25519 key, KeyList, or ThresholdKey) does not match the type of + * signature (base ed25519 signature, SignatureList, or ThresholdKeySignature) + */ + INVALID_SIGNATURE_TYPE_MISMATCHING_KEY = 51; + + /** + * the number of key (KeyList, or ThresholdKey) does not match that of signature (SignatureList, + * or ThresholdKeySignature). e.g. if a keyList has 3 base keys, then the corresponding + * signatureList should also have 3 base signatures. + */ + INVALID_SIGNATURE_COUNT_MISMATCHING_KEY = 52; + + /** + * the livehash body is empty + */ + EMPTY_LIVE_HASH_BODY = 53; + + /** + * the livehash data is missing + */ + EMPTY_LIVE_HASH = 54; + + /** + * the keys for a livehash are missing + */ + EMPTY_LIVE_HASH_KEYS = 55; + + /** + * the livehash data is not the output of a SHA-384 digest + */ + INVALID_LIVE_HASH_SIZE = 56; + + /** + * the query body is empty + */ + EMPTY_QUERY_BODY = 57; + + /** + * the crypto livehash query is empty + */ + EMPTY_LIVE_HASH_QUERY = 58; + + /** + * the livehash is not present + */ + LIVE_HASH_NOT_FOUND = 59; + + /** + * the account id passed has not yet been created. + */ + ACCOUNT_ID_DOES_NOT_EXIST = 60; + + /** + * the livehash already exists for a given account + */ + LIVE_HASH_ALREADY_EXISTS = 61; + + /** + * File WACL keys are invalid + */ + INVALID_FILE_WACL = 62; + + /** + * Serialization failure + */ + SERIALIZATION_FAILED = 63; + + /** + * The size of the Transaction is greater than transactionMaxBytes + */ + TRANSACTION_OVERSIZE = 64; + + /** + * The Transaction has more than 50 levels + */ + TRANSACTION_TOO_MANY_LAYERS = 65; + + /** + * Contract is marked as deleted + */ + CONTRACT_DELETED = 66; + + /** + * the platform node is either disconnected or lagging behind. + */ + PLATFORM_NOT_ACTIVE = 67; + + /** + * one public key matches more than one prefixes on the signature map + */ + KEY_PREFIX_MISMATCH = 68; + + /** + * transaction not created by platform due to large backlog + */ + PLATFORM_TRANSACTION_NOT_CREATED = 69; + + /** + * auto renewal period is not a positive number of seconds + */ + INVALID_RENEWAL_PERIOD = 70; + + /** + * the response code when a smart contract id is passed for a crypto API request + */ + INVALID_PAYER_ACCOUNT_ID = 71; + + /** + * the account has been marked as deleted + */ + ACCOUNT_DELETED = 72; + + /** + * the file has been marked as deleted + */ + FILE_DELETED = 73; + + /** + * same accounts repeated in the transfer account list + */ + ACCOUNT_REPEATED_IN_ACCOUNT_AMOUNTS = 74; + + /** + * attempting to set negative balance value for crypto account + */ + SETTING_NEGATIVE_ACCOUNT_BALANCE = 75; + + /** + * when deleting smart contract that has crypto balance either transfer account or transfer smart + * contract is required + */ + OBTAINER_REQUIRED = 76; + + /** + * when deleting smart contract that has crypto balance you can not use the same contract id as + * transferContractId as the one being deleted + */ + OBTAINER_SAME_CONTRACT_ID = 77; + + /** + * transferAccountId or transferContractId specified for contract delete does not exist + */ + OBTAINER_DOES_NOT_EXIST = 78; + + /** + * attempting to modify (update or delete a immutable smart contract, i.e. one created without a + * admin key) + */ + MODIFYING_IMMUTABLE_CONTRACT = 79; + + /** + * Unexpected exception thrown by file system functions + */ + FILE_SYSTEM_EXCEPTION = 80; + + /** + * the duration is not a subset of [MINIMUM_AUTORENEW_DURATION,MAXIMUM_AUTORENEW_DURATION] + */ + AUTORENEW_DURATION_NOT_IN_RANGE = 81; + + /** + * Decoding the smart contract binary to a byte array failed. Check that the input is a valid hex + * string. + */ + ERROR_DECODING_BYTESTRING = 82; + + /** + * File to create a smart contract was of length zero + */ + CONTRACT_FILE_EMPTY = 83; + + /** + * Bytecode for smart contract is of length zero + */ + CONTRACT_BYTECODE_EMPTY = 84; + + /** + * Attempt to set negative initial balance + */ + INVALID_INITIAL_BALANCE = 85; + + /** + * [Deprecated]. attempt to set negative receive record threshold + */ + INVALID_RECEIVE_RECORD_THRESHOLD = 86 [deprecated=true]; + + /** + * [Deprecated]. attempt to set negative send record threshold + */ + INVALID_SEND_RECORD_THRESHOLD = 87 [deprecated=true]; + + /** + * Special Account Operations should be performed by only Genesis account, return this code if it + * is not Genesis Account + */ + ACCOUNT_IS_NOT_GENESIS_ACCOUNT = 88; + + /** + * The fee payer account doesn't have permission to submit such Transaction + */ + PAYER_ACCOUNT_UNAUTHORIZED = 89; + + /** + * FreezeTransactionBody is invalid + */ + INVALID_FREEZE_TRANSACTION_BODY = 90; + + /** + * FreezeTransactionBody does not exist + */ + FREEZE_TRANSACTION_BODY_NOT_FOUND = 91; + + /** + * Exceeded the number of accounts (both from and to) allowed for crypto transfer list + */ + TRANSFER_LIST_SIZE_LIMIT_EXCEEDED = 92; + + /** + * Smart contract result size greater than specified maxResultSize + */ + RESULT_SIZE_LIMIT_EXCEEDED = 93; + + /** + * The payer account is not a special account(account 0.0.55) + */ + NOT_SPECIAL_ACCOUNT = 94; + + /** + * Negative gas was offered in smart contract call + */ + CONTRACT_NEGATIVE_GAS = 95; + + /** + * Negative value / initial balance was specified in a smart contract call / create + */ + CONTRACT_NEGATIVE_VALUE = 96; + + /** + * Failed to update fee file + */ + INVALID_FEE_FILE = 97; + + /** + * Failed to update exchange rate file + */ + INVALID_EXCHANGE_RATE_FILE = 98; + + /** + * Payment tendered for contract local call cannot cover both the fee and the gas + */ + INSUFFICIENT_LOCAL_CALL_GAS = 99; + + /** + * Entities with Entity ID below 1000 are not allowed to be deleted + */ + ENTITY_NOT_ALLOWED_TO_DELETE = 100; + + /** + * Violating one of these rules: 1) treasury account can update all entities below 0.0.1000, 2) + * account 0.0.50 can update all entities from 0.0.51 - 0.0.80, 3) Network Function Master Account + * A/c 0.0.50 - Update all Network Function accounts & perform all the Network Functions listed + * below, 4) Network Function Accounts: i) A/c 0.0.55 - Update Address Book files (0.0.101/102), + * ii) A/c 0.0.56 - Update Fee schedule (0.0.111), iii) A/c 0.0.57 - Update Exchange Rate + * (0.0.112). + */ + AUTHORIZATION_FAILED = 101; + + /** + * Fee Schedule Proto uploaded but not valid (append or update is required) + */ + FILE_UPLOADED_PROTO_INVALID = 102; + + /** + * Fee Schedule Proto uploaded but not valid (append or update is required) + */ + FILE_UPLOADED_PROTO_NOT_SAVED_TO_DISK = 103; + + /** + * Fee Schedule Proto File Part uploaded + */ + FEE_SCHEDULE_FILE_PART_UPLOADED = 104; + + /** + * The change on Exchange Rate exceeds Exchange_Rate_Allowed_Percentage + */ + EXCHANGE_RATE_CHANGE_LIMIT_EXCEEDED = 105; + + /** + * Contract permanent storage exceeded the currently allowable limit + */ + MAX_CONTRACT_STORAGE_EXCEEDED = 106; + + /** + * Transfer Account should not be same as Account to be deleted + */ + TRANSFER_ACCOUNT_SAME_AS_DELETE_ACCOUNT = 107; + + TOTAL_LEDGER_BALANCE_INVALID = 108; + /** + * The expiration date/time on a smart contract may not be reduced + */ + EXPIRATION_REDUCTION_NOT_ALLOWED = 110; + + /** + * Gas exceeded currently allowable gas limit per transaction + */ + MAX_GAS_LIMIT_EXCEEDED = 111; + + /** + * File size exceeded the currently allowable limit + */ + MAX_FILE_SIZE_EXCEEDED = 112; + + /** + * When a valid signature is not provided for operations on account with receiverSigRequired=true + */ + RECEIVER_SIG_REQUIRED = 113; + + /** + * The Topic ID specified is not in the system. + */ + INVALID_TOPIC_ID = 150; + + /** + * A provided admin key was invalid. + */ + INVALID_ADMIN_KEY = 155; + + /** + * A provided submit key was invalid. + */ + INVALID_SUBMIT_KEY = 156; + + /** + * An attempted operation was not authorized (ie - a deleteTopic for a topic with no adminKey). + */ + UNAUTHORIZED = 157; + + /** + * A ConsensusService message is empty. + */ + INVALID_TOPIC_MESSAGE = 158; + + /** + * The autoRenewAccount specified is not a valid, active account. + */ + INVALID_AUTORENEW_ACCOUNT = 159; + + /** + * An adminKey was not specified on the topic, so there must not be an autoRenewAccount. + */ + AUTORENEW_ACCOUNT_NOT_ALLOWED = 160; + + /** + * The topic has expired, was not automatically renewed, and is in a 7 day grace period before the + * topic will be deleted unrecoverably. This error response code will not be returned until + * autoRenew functionality is supported by HAPI. + */ + TOPIC_EXPIRED = 162; + + INVALID_CHUNK_NUMBER = 163; // chunk number must be from 1 to total (chunks) inclusive. + INVALID_CHUNK_TRANSACTION_ID = 164; // For every chunk, the payer account that is part of initialTransactionID must match the Payer Account of this transaction. The entire initialTransactionID should match the transactionID of the first chunk, but this is not checked or enforced by Hedera except when the chunk number is 1. + ACCOUNT_FROZEN_FOR_TOKEN = 165; // Account is frozen and cannot transact with the token + TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED = 166; // An involved account already has more than tokens.maxPerAccount associations with non-deleted tokens. + INVALID_TOKEN_ID = 167; // The token is invalid or does not exist + INVALID_TOKEN_DECIMALS = 168; // Invalid token decimals + INVALID_TOKEN_INITIAL_SUPPLY = 169; // Invalid token initial supply + INVALID_TREASURY_ACCOUNT_FOR_TOKEN = 170; // Treasury Account does not exist or is deleted + INVALID_TOKEN_SYMBOL = 171; // Token Symbol is not UTF-8 capitalized alphabetical string + TOKEN_HAS_NO_FREEZE_KEY = 172; // Freeze key is not set on token + TRANSFERS_NOT_ZERO_SUM_FOR_TOKEN = 173; // Amounts in transfer list are not net zero + MISSING_TOKEN_SYMBOL = 174; // A token symbol was not provided + TOKEN_SYMBOL_TOO_LONG = 175; // The provided token symbol was too long + ACCOUNT_KYC_NOT_GRANTED_FOR_TOKEN = 176; // KYC must be granted and account does not have KYC granted + TOKEN_HAS_NO_KYC_KEY = 177; // KYC key is not set on token + INSUFFICIENT_TOKEN_BALANCE = 178; // Token balance is not sufficient for the transaction + TOKEN_WAS_DELETED = 179; // Token transactions cannot be executed on deleted token + TOKEN_HAS_NO_SUPPLY_KEY = 180; // Supply key is not set on token + TOKEN_HAS_NO_WIPE_KEY = 181; // Wipe key is not set on token + INVALID_TOKEN_MINT_AMOUNT = 182; // The requested token mint amount would cause an invalid total supply + INVALID_TOKEN_BURN_AMOUNT = 183; // The requested token burn amount would cause an invalid total supply + TOKEN_NOT_ASSOCIATED_TO_ACCOUNT = 184; // A required token-account relationship is missing + CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT = 185; // The target of a wipe operation was the token treasury account + INVALID_KYC_KEY = 186; // The provided KYC key was invalid. + INVALID_WIPE_KEY = 187; // The provided wipe key was invalid. + INVALID_FREEZE_KEY = 188; // The provided freeze key was invalid. + INVALID_SUPPLY_KEY = 189; // The provided supply key was invalid. + MISSING_TOKEN_NAME = 190; // Token Name is not provided + TOKEN_NAME_TOO_LONG = 191; // Token Name is too long + INVALID_WIPING_AMOUNT = 192; // The provided wipe amount must not be negative, zero or bigger than the token holder balance + TOKEN_IS_IMMUTABLE = 193; // Token does not have Admin key set, thus update/delete transactions cannot be performed + TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT = 194; // An associateToken operation specified a token already associated to the account + TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES = 195; // An attempted operation is invalid until all token balances for the target account are zero + ACCOUNT_IS_TREASURY = 196; // An attempted operation is invalid because the account is a treasury + TOKEN_ID_REPEATED_IN_TOKEN_LIST = 197; // Same TokenIDs present in the token list + TOKEN_TRANSFER_LIST_SIZE_LIMIT_EXCEEDED = 198; // Exceeded the number of token transfers (both from and to) allowed for token transfer list + EMPTY_TOKEN_TRANSFER_BODY = 199; // TokenTransfersTransactionBody has no TokenTransferList + EMPTY_TOKEN_TRANSFER_ACCOUNT_AMOUNTS = 200; // TokenTransfersTransactionBody has a TokenTransferList with no AccountAmounts + + /** + * The Scheduled entity does not exist; or has now expired, been deleted, or been executed + */ + INVALID_SCHEDULE_ID = 201; + + /** + * The Scheduled entity cannot be modified. Admin key not set + */ + SCHEDULE_IS_IMMUTABLE = 202; + + /** + * The provided Scheduled Payer does not exist + */ + INVALID_SCHEDULE_PAYER_ID = 203; + + /** + * The Schedule Create Transaction TransactionID account does not exist + */ + INVALID_SCHEDULE_ACCOUNT_ID = 204; + + /** + * The provided sig map did not contain any new valid signatures from required signers of the scheduled transaction + */ + NO_NEW_VALID_SIGNATURES = 205; + + /** + * The required signers for a scheduled transaction cannot be resolved, for example because they do not exist or have been deleted + */ + UNRESOLVABLE_REQUIRED_SIGNERS = 206; + + /** + * Only whitelisted transaction types may be scheduled + */ + SCHEDULED_TRANSACTION_NOT_IN_WHITELIST = 207; + + /** + * At least one of the signatures in the provided sig map did not represent a valid signature for any required signer + */ + SOME_SIGNATURES_WERE_INVALID = 208; + + /** + * The scheduled field in the TransactionID may not be set to true + */ + TRANSACTION_ID_FIELD_NOT_ALLOWED = 209; + + /** + * A schedule already exists with the same identifying fields of an attempted ScheduleCreate (that is, all fields other than scheduledPayerAccountID) + */ + IDENTICAL_SCHEDULE_ALREADY_CREATED = 210; + + /** + * A string field in the transaction has a UTF-8 encoding with the prohibited zero byte + */ + INVALID_ZERO_BYTE_IN_STRING = 211; + + /** + * A schedule being signed or deleted has already been deleted + */ + SCHEDULE_ALREADY_DELETED = 212; + + /** + * A schedule being signed or deleted has already been executed + */ + SCHEDULE_ALREADY_EXECUTED = 213; + + /** + * ConsensusSubmitMessage request's message size is larger than allowed. + */ + MESSAGE_SIZE_TOO_LARGE = 214; + + /** + * An operation was assigned to more than one throttle group in a given bucket + */ + OPERATION_REPEATED_IN_BUCKET_GROUPS = 215; + + /** + * The capacity needed to satisfy all opsPerSec groups in a bucket overflowed a signed 8-byte integral type + */ + BUCKET_CAPACITY_OVERFLOW = 216; + + /** + * Given the network size in the address book, the node-level capacity for an operation would never be enough to accept a single request; usually means a bucket burstPeriod should be increased + */ + NODE_CAPACITY_NOT_SUFFICIENT_FOR_OPERATION = 217; + + /** + * A bucket was defined without any throttle groups + */ + BUCKET_HAS_NO_THROTTLE_GROUPS = 218; + + /** + * A throttle group was granted zero opsPerSec + */ + THROTTLE_GROUP_HAS_ZERO_OPS_PER_SEC = 219; + + /** + * The throttle definitions file was updated, but some supported operations were not assigned a bucket + */ + SUCCESS_BUT_MISSING_EXPECTED_OPERATION = 220; + + /** + * The new contents for the throttle definitions system file were not valid protobuf + */ + UNPARSEABLE_THROTTLE_DEFINITIONS = 221; + + /** + * The new throttle definitions system file were invalid, and no more specific error could be divined + */ + INVALID_THROTTLE_DEFINITIONS = 222; + + /** + * The transaction references an account which has passed its expiration without renewal funds available, and currently remains in the ledger only because of the grace period given to expired entities + */ + ACCOUNT_EXPIRED_AND_PENDING_REMOVAL = 223; + + /** + * Invalid token max supply + */ + INVALID_TOKEN_MAX_SUPPLY = 224; + + /** + * Invalid token nft serial number + */ + INVALID_TOKEN_NFT_SERIAL_NUMBER = 225; + + /** + * Invalid nft id + */ + INVALID_NFT_ID = 226; + + /** + * Nft metadata is too long + */ + METADATA_TOO_LONG = 227; + + /** + * Repeated operations count exceeds the limit + */ + BATCH_SIZE_LIMIT_EXCEEDED = 228; + + /** + * The range of data to be gathered is out of the set boundaries + */ + INVALID_QUERY_RANGE = 229; + + /** + * A custom fractional fee set a denominator of zero + */ + FRACTION_DIVIDES_BY_ZERO = 230; + + /** + * The transaction payer could not afford a custom fee + */ + INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE = 231 [deprecated = true]; + + /** + * More than 10 custom fees were specified + */ + CUSTOM_FEES_LIST_TOO_LONG = 232; + + /** + * Any of the feeCollector accounts for customFees is invalid + */ + INVALID_CUSTOM_FEE_COLLECTOR = 233; + + /** + * Any of the token Ids in customFees is invalid + */ + INVALID_TOKEN_ID_IN_CUSTOM_FEES = 234; + + /** + * Any of the token Ids in customFees are not associated to feeCollector + */ + TOKEN_NOT_ASSOCIATED_TO_FEE_COLLECTOR = 235; + + /** + * A token cannot have more units minted due to its configured supply ceiling + */ + TOKEN_MAX_SUPPLY_REACHED = 236; + + /** + * The transaction attempted to move an NFT serial number from an account other than its owner + */ + SENDER_DOES_NOT_OWN_NFT_SERIAL_NO = 237; + + /** + * A custom fee schedule entry did not specify either a fixed or fractional fee + */ + CUSTOM_FEE_NOT_FULLY_SPECIFIED = 238; + + /** + * Only positive fees may be assessed at this time + */ + CUSTOM_FEE_MUST_BE_POSITIVE = 239; + + /** + * Fee schedule key is not set on token + */ + TOKEN_HAS_NO_FEE_SCHEDULE_KEY = 240; + + /** + * A fractional custom fee exceeded the range of a 64-bit signed integer + */ + CUSTOM_FEE_OUTSIDE_NUMERIC_RANGE = 241; + + /** + * A royalty cannot exceed the total fungible value exchanged for an NFT + */ + ROYALTY_FRACTION_CANNOT_EXCEED_ONE = 242; + + /** + * Each fractional custom fee must have its maximum_amount, if specified, at least its minimum_amount + */ + FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT = 243; + + /** + * A fee schedule update tried to clear the custom fees from a token whose fee schedule was already empty + */ + CUSTOM_SCHEDULE_ALREADY_HAS_NO_FEES = 244; + + /** + * Only tokens of type FUNGIBLE_COMMON can be used to as fee schedule denominations + */ + CUSTOM_FEE_DENOMINATION_MUST_BE_FUNGIBLE_COMMON = 245; + + /** + * Only tokens of type FUNGIBLE_COMMON can have fractional fees + */ + CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON = 246; + + /** + * The provided custom fee schedule key was invalid + */ + INVALID_CUSTOM_FEE_SCHEDULE_KEY = 247; + + /** + * The requested token mint metadata was invalid + */ + INVALID_TOKEN_MINT_METADATA = 248; + + /** + * The requested token burn metadata was invalid + */ + INVALID_TOKEN_BURN_METADATA = 249; + + /** + * The treasury for a unique token cannot be changed until it owns no NFTs + */ + CURRENT_TREASURY_STILL_OWNS_NFTS = 250; + + /** + * An account cannot be dissociated from a unique token if it owns NFTs for the token + */ + ACCOUNT_STILL_OWNS_NFTS = 251; + + /** + * A NFT can only be burned when owned by the unique token's treasury + */ + TREASURY_MUST_OWN_BURNED_NFT = 252; + + /** + * An account did not own the NFT to be wiped + */ + ACCOUNT_DOES_NOT_OWN_WIPED_NFT = 253; + + /** + * An AccountAmount token transfers list referenced a token type other than FUNGIBLE_COMMON + */ + ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON = 254; + + /** + * All the NFTs allowed in the current price regime have already been minted + */ + MAX_NFTS_IN_PRICE_REGIME_HAVE_BEEN_MINTED = 255; + + /** + * The payer account has been marked as deleted + */ + PAYER_ACCOUNT_DELETED = 256; + + /** + * The reference chain of custom fees for a transferred token exceeded the maximum length of 2 + */ + CUSTOM_FEE_CHARGING_EXCEEDED_MAX_RECURSION_DEPTH = 257; + + /** + * More than 20 balance adjustments were to satisfy a CryptoTransfer and its implied custom fee payments + */ + CUSTOM_FEE_CHARGING_EXCEEDED_MAX_ACCOUNT_AMOUNTS = 258; + + /** + * The sender account in the token transfer transaction could not afford a custom fee + */ + INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE = 259; + + /** + * Currently no more than 4,294,967,295 NFTs may be minted for a given unique token type + */ + SERIAL_NUMBER_LIMIT_REACHED = 260; + + /** + * Only tokens of type NON_FUNGIBLE_UNIQUE can have royalty fees + */ + CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE = 261; + + /** + * The account has reached the limit on the automatic associations count. + */ + NO_REMAINING_AUTOMATIC_ASSOCIATIONS = 262; + + /** + * Already existing automatic associations are more than the new maximum automatic associations. + */ + EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT = 263; + + /** + * Cannot set the number of automatic associations for an account more than the maximum allowed + * token associations tokens.maxPerAccount. + */ + REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT = 264; + + /** + * Token is paused. This Token cannot be a part of any kind of Transaction until unpaused. + */ + TOKEN_IS_PAUSED = 265; + + /** + * Pause key is not set on token + */ + TOKEN_HAS_NO_PAUSE_KEY = 266; + + /** + * The provided pause key was invalid + */ + INVALID_PAUSE_KEY = 267; + + /** + * The update file in a freeze transaction body must exist. + */ + FREEZE_UPDATE_FILE_DOES_NOT_EXIST = 268; + + /** + * The hash of the update file in a freeze transaction body must match the in-memory hash. + */ + FREEZE_UPDATE_FILE_HASH_DOES_NOT_MATCH = 269; + + /** + * A FREEZE_UPGRADE transaction was handled with no previous update prepared. + */ + NO_UPGRADE_HAS_BEEN_PREPARED = 270; + + /** + * A FREEZE_ABORT transaction was handled with no scheduled freeze. + */ + NO_FREEZE_IS_SCHEDULED = 271; + + /** + * The update file hash when handling a FREEZE_UPGRADE transaction differs from the file + * hash at the time of handling the PREPARE_UPGRADE transaction. + */ + UPDATE_FILE_HASH_CHANGED_SINCE_PREPARE_UPGRADE = 272; + + /** + * The given freeze start time was in the (consensus) past. + */ + FREEZE_START_TIME_MUST_BE_FUTURE = 273; + + /** + * The prepared update file cannot be updated or appended until either the upgrade has + * been completed, or a FREEZE_ABORT has been handled. + */ + PREPARED_UPDATE_FILE_IS_IMMUTABLE = 274; + + /** + * Once a freeze is scheduled, it must be aborted before any other type of freeze can + * can be performed. + */ + FREEZE_ALREADY_SCHEDULED = 275; + + /** + * If an NMT upgrade has been prepared, the following operation must be a FREEZE_UPGRADE. + * (To issue a FREEZE_ONLY, submit a FREEZE_ABORT first.) + */ + FREEZE_UPGRADE_IN_PROGRESS = 276; + + /** + * If an NMT upgrade has been prepared, the subsequent FREEZE_UPGRADE transaction must + * confirm the id of the file to be used in the upgrade. + */ + UPDATE_FILE_ID_DOES_NOT_MATCH_PREPARED = 277; + + /** + * If an NMT upgrade has been prepared, the subsequent FREEZE_UPGRADE transaction must + * confirm the hash of the file to be used in the upgrade. + */ + UPDATE_FILE_HASH_DOES_NOT_MATCH_PREPARED = 278; + + /** + * Consensus throttle did not allow execution of this transaction. System is throttled at + * consensus level. + */ + CONSENSUS_GAS_EXHAUSTED = 279; + + /** + * A precompiled contract succeeded, but was later reverted. + */ + REVERTED_SUCCESS = 280; + + /** + * All contract storage allocated to the current price regime has been consumed. + */ + MAX_STORAGE_IN_PRICE_REGIME_HAS_BEEN_USED = 281; + + /** + * An alias used in a CryptoTransfer transaction is not the serialization of a primitive Key + * message--that is, a Key with a single Ed25519 or ECDSA(secp256k1) public key and no + * unknown protobuf fields. + */ + INVALID_ALIAS_KEY = 282; +} diff --git a/services/response_header.proto b/services/response_header.proto new file mode 100644 index 00000000..806f7264 --- /dev/null +++ b/services/response_header.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "transaction_response.proto"; +import "query_header.proto"; +import "response_code.proto"; + +/** + * Every query receives a response containing the QueryResponseHeader. Either or both of the cost + * and stateProof fields may be blank, if the responseType didn't ask for the cost or stateProof. + */ +message ResponseHeader { + /** + * Result of fee transaction precheck, saying it passed, or why it failed + */ + ResponseCodeEnum nodeTransactionPrecheckCode = 1; + + /** + * The requested response is repeated back here, for convenience + */ + ResponseType responseType = 2; + + /** + * The fee that would be charged to get the requested information (if a cost was requested). + * Note: This cost only includes the query fee and does not include the transfer fee(which is + * required to execute the transfer transaction to debit the payer account and credit the node + * account with query fee) + */ + uint64 cost = 3; + + /** + * The state proof for this information (if a state proof was requested, and is available) + */ + bytes stateProof = 4; +} diff --git a/services/schedulable_transaction_body.proto b/services/schedulable_transaction_body.proto new file mode 100644 index 00000000..44a8b0cd --- /dev/null +++ b/services/schedulable_transaction_body.proto @@ -0,0 +1,259 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "system_delete.proto"; +import "system_undelete.proto"; +import "freeze.proto"; + +import "contract_call.proto"; +import "contract_create.proto"; +import "contract_update.proto"; + +import "crypto_create.proto"; +import "crypto_delete.proto"; +import "crypto_transfer.proto"; +import "crypto_update.proto"; + +import "file_append.proto"; +import "file_create.proto"; +import "file_delete.proto"; +import "file_update.proto"; + +import "contract_delete.proto"; + +import "consensus_create_topic.proto"; +import "consensus_update_topic.proto"; +import "consensus_delete_topic.proto"; +import "consensus_submit_message.proto"; + +import "token_create.proto"; +import "token_freeze_account.proto"; +import "token_unfreeze_account.proto"; +import "token_grant_kyc.proto"; +import "token_revoke_kyc.proto"; +import "token_delete.proto"; +import "token_update.proto"; +import "token_mint.proto"; +import "token_burn.proto"; +import "token_wipe_account.proto"; +import "token_associate.proto"; +import "token_dissociate.proto"; +import "token_pause.proto"; +import "token_unpause.proto"; + +import "schedule_delete.proto"; + +/** + * A schedulable transaction. Note that the global/dynamic system property + * scheduling.whitelist controls which transaction types may be scheduled. In Hedera + * Services 0.13.0, it will include only CryptoTransfer and ConsensusSubmitMessage + * functions. + */ +message SchedulableTransactionBody { + /** + * The maximum transaction fee the client is willing to pay + */ + uint64 transactionFee = 1; + + /** + * A memo to include the execution record; the UTF-8 encoding may be up to 100 bytes and must not + * include the zero byte + */ + string memo = 2; + + oneof data { + /** + * Calls a function of a contract instance + */ + ContractCallTransactionBody contractCall = 3; + + /** + * Creates a contract instance + */ + ContractCreateTransactionBody contractCreateInstance = 4; + + /** + * Updates a contract + */ + ContractUpdateTransactionBody contractUpdateInstance = 5; + + /** + * Delete contract and transfer remaining balance into specified account + */ + ContractDeleteTransactionBody contractDeleteInstance = 6; + + /** + * Create a new cryptocurrency account + */ + CryptoCreateTransactionBody cryptoCreateAccount = 7; + + /** + * Delete a cryptocurrency account (mark as deleted, and transfer hbars out) + */ + CryptoDeleteTransactionBody cryptoDelete = 8; + + /** + * Transfer amount between accounts + */ + CryptoTransferTransactionBody cryptoTransfer = 9; + + /** + * Modify information such as the expiration date for an account + */ + CryptoUpdateTransactionBody cryptoUpdateAccount = 10; + + /** + * Add bytes to the end of the contents of a file + */ + FileAppendTransactionBody fileAppend = 11; + + /** + * Create a new file + */ + FileCreateTransactionBody fileCreate = 12; + + /** + * Delete a file (remove contents and mark as deleted until it expires) + */ + FileDeleteTransactionBody fileDelete = 13; + + /** + * Modify information such as the expiration date for a file + */ + FileUpdateTransactionBody fileUpdate = 14; + + /** + * Hedera administrative deletion of a file or smart contract + */ + SystemDeleteTransactionBody systemDelete = 15; + + /** + * To undelete an entity deleted by SystemDelete + */ + SystemUndeleteTransactionBody systemUndelete = 16; + + /** + * Freeze the nodes + */ + FreezeTransactionBody freeze = 17; + + /** + * Creates a topic + */ + ConsensusCreateTopicTransactionBody consensusCreateTopic = 18; + + /** + * Updates a topic + */ + ConsensusUpdateTopicTransactionBody consensusUpdateTopic = 19; + + /** + * Deletes a topic + */ + ConsensusDeleteTopicTransactionBody consensusDeleteTopic = 20; + + /** + * Submits message to a topic + */ + ConsensusSubmitMessageTransactionBody consensusSubmitMessage = 21; + + /** + * Creates a token instance + */ + TokenCreateTransactionBody tokenCreation = 22; + + /** + * Freezes account not to be able to transact with a token + */ + TokenFreezeAccountTransactionBody tokenFreeze = 23; + + /** + * Unfreezes account for a token + */ + TokenUnfreezeAccountTransactionBody tokenUnfreeze = 24; + + /** + * Grants KYC to an account for a token + */ + TokenGrantKycTransactionBody tokenGrantKyc = 25; + + /** + * Revokes KYC of an account for a token + */ + TokenRevokeKycTransactionBody tokenRevokeKyc = 26; + + /** + * Deletes a token instance + */ + TokenDeleteTransactionBody tokenDeletion = 27; + + /** + * Updates a token instance + */ + TokenUpdateTransactionBody tokenUpdate = 28; + + /** + * Mints new tokens to a token's treasury account + */ + TokenMintTransactionBody tokenMint = 29; + + /** + * Burns tokens from a token's treasury account + */ + TokenBurnTransactionBody tokenBurn = 30; + + /** + * Wipes amount of tokens from an account + */ + TokenWipeAccountTransactionBody tokenWipe = 31; + + /** + * Associate tokens to an account + */ + TokenAssociateTransactionBody tokenAssociate = 32; + + /** + * Dissociate tokens from an account + */ + TokenDissociateTransactionBody tokenDissociate = 33; + + /** + * Pauses the Token + */ + TokenPauseTransactionBody token_pause = 35; + + /** + * Unpauses the Token + */ + TokenUnpauseTransactionBody token_unpause = 36; + + /** + * Marks a schedule in the network's action queue as deleted, preventing it from executing + */ + ScheduleDeleteTransactionBody scheduleDelete = 34; + } +} diff --git a/services/schedule_create.proto b/services/schedule_create.proto new file mode 100644 index 00000000..7eb85892 --- /dev/null +++ b/services/schedule_create.proto @@ -0,0 +1,93 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "schedulable_transaction_body.proto"; + +/** + * Create a new schedule entity (or simply, schedule) in the network's action queue. + * Upon SUCCESS, the receipt contains the `ScheduleID` of the created schedule. A schedule + * entity includes a scheduledTransactionBody to be executed when the schedule has + * collected enough signing Ed25519 keys to satisfy the scheduled transaction's signing + * requirements. Upon `SUCCESS`, the receipt also includes the scheduledTransactionID to + * use to query for the record of the scheduled transaction's execution (if it occurs). + * + * The expiration time of a schedule is always 30 minutes; it remains in state and can be queried + * using GetScheduleInfo until expiration, no matter if the scheduled transaction has + * executed or marked deleted. + * + * If the adminKey field is omitted, the resulting schedule is immutable. If the + * adminKey is set, the ScheduleDelete transaction can be used to mark it as + * deleted. The creator may also specify an optional memo whose UTF-8 encoding is at most + * 100 bytes and does not include the zero byte is also supported. + * + * When a scheduled transaction whose schedule has collected enough signing keys is executed, the + * network only charges its payer the service fee, and not the node and network fees. If the + * optional payerAccountID is set, the network charges this account. Otherwise it charges + * the payer of the originating ScheduleCreate. + * + * Two ScheduleCreate transactions are identical if they are equal in all their + * fields other than payerAccountID. (Here "equal" should be understood in the sense of + * gRPC object equality in the network software runtime. In particular, a gRPC object with unknown fields is + * not equal to a gRPC object without unknown fields, even if they agree on all known fields.) + * + * A ScheduleCreate transaction that attempts to re-create an identical schedule already in + * state will receive a receipt with status IDENTICAL_SCHEDULE_ALREADY_CREATED; the receipt + * will include the ScheduleID of the extant schedule, which may be used in a subsequent + * ScheduleSign transaction. (The receipt will also include the TransactionID to + * use in querying for the receipt or record of the scheduled transaction.) + * + * Other notable response codes include, INVALID_ACCOUNT_ID, + * UNSCHEDULABLE_TRANSACTION, UNRESOLVABLE_REQUIRED_SIGNERS, + * INVALID_SIGNATURE. For more information please see the section of this documentation on + * the ResponseCode enum. + */ +message ScheduleCreateTransactionBody { + /** + * The scheduled transaction + */ + SchedulableTransactionBody scheduledTransactionBody = 1; + + /** + * An optional memo with a UTF-8 encoding of no more than 100 bytes which does not contain the + * zero byte + */ + string memo = 2; + + /** + * An optional Hedera key which can be used to sign a ScheduleDelete and remove the schedule + */ + Key adminKey = 3; + + /** + * An optional id of the account to be charged the service fee for the scheduled transaction at + * the consensus time that it executes (if ever); defaults to the ScheduleCreate payer if not + * given + */ + AccountID payerAccountID = 4; +} diff --git a/services/ScheduleDelete.proto b/services/schedule_delete.proto similarity index 58% rename from services/ScheduleDelete.proto rename to services/schedule_delete.proto index 3d155117..1bab91bc 100644 --- a/services/ScheduleDelete.proto +++ b/services/schedule_delete.proto @@ -25,15 +25,21 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "BasicTypes.proto"; +import "basic_types.proto"; -/* -Marks a schedule in the network's action queue as deleted. Must be signed by the admin key of the target schedule. -A deleted schedule cannot receive any additional signing keys, nor will it be executed. - -Other notable response codes include, INVALID_SCHEDULE_ID, SCHEDULE_WAS_DELETED, SCHEDULE_WAS_EXECUTED, -SCHEDULE_IS_IMMUTABLE. For more information please see the section of this documentation on the ResponseCode enum. +/** + * Marks a schedule in the network's action queue as deleted. Must be signed by the admin key of the + * target schedule. A deleted schedule cannot receive any additional signing keys, nor will it be + * executed. + * + * Other notable response codes include, INVALID_SCHEDULE_ID, + * SCHEDULE_WAS_DELETED, SCHEDULE_WAS_EXECUTED, SCHEDULE_IS_IMMUTABLE. + * For more information please see the section of this documentation on the ResponseCode + * enum. */ message ScheduleDeleteTransactionBody { - ScheduleID scheduleID = 1; // The ID of the Scheduled Entity + /** + * The ID of the Scheduled Entity + */ + ScheduleID scheduleID = 1; } diff --git a/services/schedule_get_info.proto b/services/schedule_get_info.proto new file mode 100644 index 00000000..fc8f45c6 --- /dev/null +++ b/services/schedule_get_info.proto @@ -0,0 +1,129 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "timestamp.proto"; +import "query_header.proto"; +import "response_header.proto"; +import "schedulable_transaction_body.proto"; + +/** + * Gets information about a schedule in the network's action queue. + * + * Responds with INVALID_SCHEDULE_ID if the requested schedule doesn't exist. + */ +message ScheduleGetInfoQuery { + /** + * standard info sent from client to node including the signed payment, and what kind of response + * is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + /** + * The id of the schedule to interrogate + */ + ScheduleID scheduleID = 2; +} + +/** + * Information summarizing schedule state + */ +message ScheduleInfo { + /** + * The id of the schedule + */ + ScheduleID scheduleID = 1; + + oneof data { + /** + * If the schedule has been deleted, the consensus time when this occurred + */ + Timestamp deletion_time = 2; + + /** + * If the schedule has been executed, the consensus time when this occurred + */ + Timestamp execution_time = 3; + } + + /** + * The time at which the schedule will expire + */ + Timestamp expirationTime = 4; + + /** + * The scheduled transaction + */ + SchedulableTransactionBody scheduledTransactionBody = 5; + + /** + * The publicly visible memo of the schedule + */ + string memo = 6; + + /** + * The key used to delete the schedule from state + */ + Key adminKey = 7; + + /** + * The Ed25519 keys the network deems to have signed the scheduled transaction + */ + KeyList signers = 8; + + /** + * The id of the account that created the schedule + */ + AccountID creatorAccountID = 9; + + /** + * The id of the account responsible for the service fee of the scheduled transaction + */ + AccountID payerAccountID = 10; + + /** + * The transaction id that will be used in the record of the scheduled transaction (if it + * executes) + */ + TransactionID scheduledTransactionID = 11; +} + +/** + * Response wrapper for the ScheduleInfo + */ +message ScheduleGetInfoResponse { + /** + * Standard response from node to client, including the requested fields: cost, or state proof, or + * both, or neither + */ + ResponseHeader header = 1; + + /** + * The information requested about this schedule instance + */ + ScheduleInfo scheduleInfo = 2; +} diff --git a/services/schedule_service.proto b/services/schedule_service.proto new file mode 100644 index 00000000..2d32cf29 --- /dev/null +++ b/services/schedule_service.proto @@ -0,0 +1,77 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.service.proto.java"; + +import "query.proto"; +import "response.proto"; +import "transaction_response.proto"; +import "transaction.proto"; + +/** + * Transactions and queries for the Schedule Service + * The Schedule Service allows transactions to be submitted without all the required signatures and + * allows anyone to provide the required signatures independently after a transaction has already + * been created. + * Execution: + * Scheduled Transactions are executed once all required signatures are collected and witnessed. + * Every time new signature is provided, a check is performed on the "readiness" of the execution. + * The Scheduled Transaction will be executed immediately after the transaction that triggered it + * and will be externalised in a separate Transaction Record. + * Transaction Record: + * The timestamp of the Scheduled Transaction will be equal to consensusTimestamp + 1 nano, where + * consensusTimestamp is the timestamp of the transaction that triggered the execution. + * The Transaction ID of the Scheduled Transaction will have the scheduled property set to true and + * inherit the transactionValidStart and accountID from the ScheduleCreate transaction. + * The scheduleRef property of the transaction record will be populated with the ScheduleID of the + * Scheduled Transaction. + * Post execution: + * Once a given Scheduled Transaction executes, it will be removed from the ledger and any upcoming + * operation referring the ScheduleID will resolve to INVALID_SCHEDULE_ID. + * Expiry: + * Scheduled Transactions have a global expiry time txExpiryTimeSecs (Currently set to 30 minutes). + * If txExpiryTimeSecs pass and the Scheduled Transaction haven't yet executed, it will be removed + * from the ledger as if ScheduleDelete operation is executed. + */ +service ScheduleService { + /** + * Creates a new Schedule by submitting the transaction + */ + rpc createSchedule (Transaction) returns (TransactionResponse); + + /** + * Signs a new Schedule by submitting the transaction + */ + rpc signSchedule (Transaction) returns (TransactionResponse); + + /** + * Deletes a new Schedule by submitting the transaction + */ + rpc deleteSchedule (Transaction) returns (TransactionResponse); + + /** + * Retrieves the metadata of a schedule entity + */ + rpc getScheduleInfo (Query) returns (Response); +} diff --git a/services/schedule_sign.proto b/services/schedule_sign.proto new file mode 100644 index 00000000..d379507d --- /dev/null +++ b/services/schedule_sign.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Adds zero or more signing keys to a schedule. If the resulting set of signing keys satisfy the + * scheduled transaction's signing requirements, it will be executed immediately after the + * triggering ScheduleSign. + * + * Upon SUCCESS, the receipt includes the scheduledTransactionID to use to query + * for the record of the scheduled transaction's execution (if it occurs). + * + * Other notable response codes include INVALID_SCHEDULE_ID, SCHEDULE_WAS_DELETD, + * INVALID_ACCOUNT_ID, UNRESOLVABLE_REQUIRED_SIGNERS, + * SOME_SIGNATURES_WERE_INVALID, and NO_NEW_VALID_SIGNATURES. For more information + * please see the section of this documentation on the ResponseCode enum. + */ +message ScheduleSignTransactionBody { + /** + * The id of the schedule to add signing keys to + */ + ScheduleID scheduleID = 1; +} diff --git a/services/SmartContractService.proto b/services/smart_contract_service.proto similarity index 62% rename from services/SmartContractService.proto rename to services/smart_contract_service.proto index fa180e83..303ffac1 100644 --- a/services/SmartContractService.proto +++ b/services/smart_contract_service.proto @@ -23,37 +23,70 @@ package proto; */ option java_package = "com.hederahashgraph.service.proto.java"; -import "TransactionResponse.proto"; -import "Query.proto"; -import "Response.proto"; -import "Transaction.proto"; - -/* -Transactions and queries for the file service. -*/ +import "transaction_response.proto"; +import "query.proto"; +import "response.proto"; +import "transaction.proto"; + +/** + * Transactions and queries for the file service. + */ service SmartContractService { - // Creates a contract + /** + * Creates a contract + */ rpc createContract (Transaction) returns (TransactionResponse); - // Updates a contract with the content + + /** + * Updates a contract with the content + */ rpc updateContract (Transaction) returns (TransactionResponse); - // Calls a contract + + /** + * Calls a contract + */ rpc contractCallMethod (Transaction) returns (TransactionResponse); - // Retrieves the contract information + + /** + * Retrieves the contract information + */ rpc getContractInfo (Query) returns (Response); - // Calls a smart contract to be run on a single node + + /** + * Calls a smart contract to be run on a single node + */ rpc contractCallLocalMethod (Query) returns (Response); - // Retrieves the byte code of a contract + + /** + * Retrieves the byte code of a contract + */ rpc ContractGetBytecode (Query) returns (Response); - // Retrieves a contract by its Solidity address + + /** + * Retrieves a contract by its Solidity address + */ rpc getBySolidityID (Query) returns (Response); - // Always returns an empty record list, as contract accounts are never effective payers for transactions + + /** + * Always returns an empty record list, as contract accounts are never effective payers for + * transactions + */ rpc getTxRecordByContractID (Query) returns (Response) { option deprecated = true; }; - // Deletes a contract instance and transfers any remaining hbars to a specified receiver + + /** + * Deletes a contract instance and transfers any remaining hbars to a specified receiver + */ rpc deleteContract (Transaction) returns (TransactionResponse); - // Deletes a contract if the submitting account has network admin privileges + + /** + * Deletes a contract if the submitting account has network admin privileges + */ rpc systemDelete (Transaction) returns (TransactionResponse); - // Undeletes a contract if the submitting account has network admin privileges + + /** + * Undeletes a contract if the submitting account has network admin privileges + */ rpc systemUndelete (Transaction) returns (TransactionResponse); } diff --git a/services/system_delete.proto b/services/system_delete.proto new file mode 100644 index 00000000..011c6b97 --- /dev/null +++ b/services/system_delete.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "timestamp.proto"; + +/** + * Delete a file or smart contract - can only be done with a Hedera administrative multisignature. + * When it is deleted, it immediately disappears from the system as seen by the user, but is still + * stored internally until the expiration time, at which time it is truly and permanently deleted. + * Until that time, it can be undeleted by the Hedera administrative multisignature. When a smart + * contract is deleted, the cryptocurrency account within it continues to exist, and is not affected + * by the expiration time here. + */ +message SystemDeleteTransactionBody { + oneof id { + /** + * The file ID of the file to delete, in the format used in transactions + */ + FileID fileID = 1; + + /** + * The contract ID instance to delete, in the format used in transactions + */ + ContractID contractID = 2; + } + + /** + * The timestamp in seconds at which the "deleted" file should truly be permanently deleted + */ + TimestampSeconds expirationTime = 3; +} diff --git a/services/SystemUndelete.proto b/services/system_undelete.proto similarity index 67% rename from services/SystemUndelete.proto rename to services/system_undelete.proto index 7aafbdcd..39a4c9fd 100644 --- a/services/SystemUndelete.proto +++ b/services/system_undelete.proto @@ -25,14 +25,22 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "BasicTypes.proto"; +import "basic_types.proto"; -/* -Undelete a file or smart contract that was deleted by SystemDelete; requires a Hedera administrative multisignature. -*/ +/** + * Undelete a file or smart contract that was deleted by SystemDelete; requires a Hedera + * administrative multisignature. + */ message SystemUndeleteTransactionBody { oneof id { - FileID fileID = 1; // The file ID to undelete, in the format used in transactions - ContractID contractID = 2; // The contract ID instance to undelete, in the format used in transactions + /** + * The file ID to undelete, in the format used in transactions + */ + FileID fileID = 1; + + /** + * The contract ID instance to undelete, in the format used in transactions + */ + ContractID contractID = 2; } } diff --git a/services/throttle_definitions.proto b/services/throttle_definitions.proto new file mode 100644 index 00000000..df86362a --- /dev/null +++ b/services/throttle_definitions.proto @@ -0,0 +1,85 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * For details behind this throttling design, please see the docs/throttle-design.md document + * in the Hedera Services repository. + */ + +/** + * A set of operations which should be collectively throttled at a given milli-ops-per-second limit. + */ +message ThrottleGroup { + /** + * The operations to be throttled + */ + repeated HederaFunctionality operations = 1; + + /** + * The number of total operations per second across the entire network, multiplied by 1000. So, to + * choose 3 operations per second (which on a network of 30 nodes is a tenth of an operation per + * second for each node), set milliOpsPerSec = 3000. And to choose 3.6 ops per second, use + * milliOpsPerSec = 3600. Minimum allowed value is 1, and maximum allowed value is 9223372. + */ + uint64 milliOpsPerSec = 2; +} + +/** + * A list of throttle groups that should all compete for the same internal bucket. + */ +message ThrottleBucket { + /** + * A name for this bucket (primarily for use in logs) + */ + string name = 1; + + /** + * The number of milliseconds required for this bucket to drain completely when full. The product + * of this number and the least common multiple of the milliOpsPerSec values in this bucket must + * not exceed 9223372036. + */ + uint64 burstPeriodMs = 2; + + /** + * The throttle groups competing for this bucket + */ + repeated ThrottleGroup throttleGroups = 3; +} + +/** + * A list of throttle buckets which, simultaneously enforced, define the system's throttling policy. + *
    + *
  1. When an operation appears in more than one throttling bucket, all its buckets must have room + * or it will be throttled.
  2. + *
  3. An operation assigned to no buckets is always throttled.
  4. + *
+ */ +message ThrottleDefinitions { + repeated ThrottleBucket throttleBuckets = 1; +} diff --git a/services/Timestamp.proto b/services/timestamp.proto similarity index 59% rename from services/Timestamp.proto rename to services/timestamp.proto index 93080df3..6777196d 100644 --- a/services/Timestamp.proto +++ b/services/timestamp.proto @@ -25,14 +25,29 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -/* An exact date and time. This is the same data structure as the protobuf Timestamp.proto (see the comments in https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto) */ +/** + * An exact date and time. This is the same data structure as the protobuf Timestamp.proto (see the + * comments in https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto) + */ message Timestamp { - int64 seconds = 1; // Number of complete seconds since the start of the epoch - int32 nanos = 2; // Number of nanoseconds since the start of the last second + /** + * Number of complete seconds since the start of the epoch + */ + int64 seconds = 1; + + /** + * Number of nanoseconds since the start of the last second + */ + int32 nanos = 2; } -/* An exact date and time, with a resolution of one second (no nanoseconds). */ +/** + * An exact date and time, with a resolution of one second (no nanoseconds). + */ message TimestampSeconds { - int64 seconds = 1; // Number of complete seconds since the start of the epoch + /** + * Number of complete seconds since the start of the epoch + */ + int64 seconds = 1; } diff --git a/services/token_associate.proto b/services/token_associate.proto new file mode 100644 index 00000000..bfbac1de --- /dev/null +++ b/services/token_associate.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Associates the provided account with the provided tokens. Must be signed by the provided + * Account's key. + * If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID. + * If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED. + * If any of the provided tokens is not found, the transaction will resolve to INVALID_TOKEN_REF. + * If any of the provided tokens has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. + * If an association between the provided account and any of the tokens already exists, the + * transaction will resolve to TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT. + * If the provided account's associations count exceed the constraint of maximum token associations + * per account, the transaction will resolve to TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED. + * On success, associations between the provided account and tokens are made and the account is + * ready to interact with the tokens. + */ +message TokenAssociateTransactionBody { + /** + * The account to be associated with the provided tokens + */ + AccountID account = 1; + + /** + * The tokens to be associated with the provided account. In the case of NON_FUNGIBLE_UNIQUE + * Type, once an account is associated, it can hold any number of NFTs (serial numbers) of that + * token type + */ + repeated TokenID tokens = 2; +} diff --git a/services/token_burn.proto b/services/token_burn.proto new file mode 100644 index 00000000..b8283e00 --- /dev/null +++ b/services/token_burn.proto @@ -0,0 +1,66 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Burns tokens from the Token's treasury Account. If no Supply Key is defined, the transaction will + * resolve to TOKEN_HAS_NO_SUPPLY_KEY. + * The operation decreases the Total Supply of the Token. Total supply cannot go below zero. + * The amount provided must be in the lowest denomination possible. Example: + * Token A has 2 decimals. In order to burn 100 tokens, one must provide amount of 10000. In order + * to burn 100.55 tokens, one must provide amount of 10055. + * For non fungible tokens the transaction body accepts serialNumbers list of integers as a parameter. + * + * If neither the amount nor the serialNumbers get filled, a INVALID_TOKEN_BURN_AMOUNT response code + * will be returned. + * If both amount and serialNumbers get filled, a INVALID_TRANSACTION_BODY response code will be + * returned. + * If the serialNumbers' list count is greater than the batch size limit global dynamic property, a + * BATCH_SIZE_LIMIT_EXCEEDED response code will be returned. + * If the serialNumbers list contains a non-positive integer as a serial number, a INVALID_NFT_ID + * response code will be returned. + */ +message TokenBurnTransactionBody { + /** + * The token for which to burn tokens. If token does not exist, transaction results in + * INVALID_TOKEN_ID + */ + TokenID token = 1; + + /** + * Applicable to tokens of type FUNGIBLE_COMMON. The amount to burn from the Treasury Account. + * Amount must be a positive non-zero number, not bigger than the token balance of the treasury + * account (0; balance], represented in the lowest denomination. + */ + uint64 amount = 2; + + /** + * Applicable to tokens of type NON_FUNGIBLE_UNIQUE. The list of serial numbers to be burned. + */ + repeated int64 serialNumbers = 3; +} diff --git a/services/token_create.proto b/services/token_create.proto new file mode 100644 index 00000000..b844ddab --- /dev/null +++ b/services/token_create.proto @@ -0,0 +1,202 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "duration.proto"; +import "basic_types.proto"; +import "custom_fees.proto"; +import "timestamp.proto"; + +/** + * Create a new token. After the token is created, the Token ID for it is in the receipt. + * The specified Treasury Account is receiving the initial supply of tokens as-well as the tokens + * from the Token Mint operation once executed. The balance of the treasury account is decreased + * when the Token Burn operation is executed. + * + * The initialSupply is the initial supply of the smallest parts of a token (like a + * tinybar, not an hbar). These are the smallest units of the token which may be transferred. + * + * The supply can change over time. If the total supply at some moment is S parts of tokens, + * and the token is using D decimals, then S must be less than or equal to + * 263-1, which is 9,223,372,036,854,775,807. The number of whole tokens (not parts) will + * be S / 10D. + * + * If decimals is 8 or 11, then the number of whole tokens can be at most a few billions or + * millions, respectively. For example, it could match Bitcoin (21 million whole tokens with 8 + * decimals) or hbars (50 billion whole tokens with 8 decimals). It could even match Bitcoin with + * milli-satoshis (21 million whole tokens with 11 decimals). + * + * Note that a created token is immutable if the adminKey is omitted. No property of + * an immutable token can ever change, with the sole exception of its expiry. Anyone can pay to + * extend the expiry time of an immutable token. + * + * A token can be either FUNGIBLE_COMMON or NON_FUNGIBLE_UNIQUE, based on its + * TokenType. If it has been omitted, FUNGIBLE_COMMON type is used. + * + * A token can have either INFINITE or FINITE supply type, based on its + * TokenType. If it has been omitted, INFINITE type is used. + * + * If a FUNGIBLE TokenType is used, initialSupply should explicitly be set to a + * non-negative. If not, the transaction will resolve to INVALID_TOKEN_INITIAL_SUPPLY. + * + * If a NON_FUNGIBLE_UNIQUE TokenType is used, initialSupply should explicitly be set + * to 0. If not, the transaction will resolve to INVALID_TOKEN_INITIAL_SUPPLY. + * + * If an INFINITE TokenSupplyType is used, maxSupply should explicitly be set to 0. If + * it is not 0, the transaction will resolve to INVALID_TOKEN_MAX_SUPPLY. + * + * If a FINITE TokenSupplyType is used, maxSupply should be explicitly set to a + * non-negative value. If it is not, the transaction will resolve to INVALID_TOKEN_MAX_SUPPLY. + */ +message TokenCreateTransactionBody { + /** + * The publicly visible name of the token. The token name is specified as a Unicode string. + * Its UTF-8 encoding cannot exceed 100 bytes, and cannot contain the 0 byte (NUL). + * length tokens.maxSymbolUtf8Bytes. + */ + string name = 1; + + /** + * The publicly visible token symbol. The token symbol is specified as a Unicode string. + * Its UTF-8 encoding cannot exceed 100 bytes, and cannot contain the 0 byte (NUL). + * tokens.maxTokenNameUtf8Bytes. + */ + string symbol = 2; + + /** + * For tokens of type FUNGIBLE_COMMON - the number of decimal places a + * token is divisible by. For tokens of type NON_FUNGIBLE_UNIQUE - value + * must be 0 + */ + uint32 decimals = 3; + + /** + * Specifies the initial supply of tokens to be put in circulation. The + * initial supply is sent to the Treasury Account. The supply is in the + * lowest denomination possible. In the case for NON_FUNGIBLE_UNIQUE Type + * the value must be 0 + */ + uint64 initialSupply = 4; + + /** + * The account which will act as a treasury for the token. This account + * will receive the specified initial supply or the newly minted NFTs in + * the case for NON_FUNGIBLE_UNIQUE Type + */ + AccountID treasury = 5; + + /** + * The key which can perform update/delete operations on the token. If empty, the token can be + * perceived as immutable (not being able to be updated/deleted) + */ + Key adminKey = 6; + + /** + * The key which can grant or revoke KYC of an account for the token's transactions. If empty, + * KYC is not required, and KYC grant or revoke operations are not possible. + */ + Key kycKey = 7; + + /** + * The key which can sign to freeze or unfreeze an account for token transactions. If empty, + * freezing is not possible + */ + Key freezeKey = 8; + + /** + * The key which can wipe the token balance of an account. If empty, wipe is not possible + */ + Key wipeKey = 9; + + /** + * The key which can change the supply of a token. The key is used to sign Token Mint/Burn + * operations + */ + Key supplyKey = 10; + + /** + * The default Freeze status (frozen or unfrozen) of Hedera accounts relative to this token. If + * true, an account must be unfrozen before it can receive the token + */ + bool freezeDefault = 11; + + /** + * The epoch second at which the token should expire; if an auto-renew account and period are + * specified, this is coerced to the current epoch second plus the autoRenewPeriod + */ + Timestamp expiry = 13; + + /** + * An account which will be automatically charged to renew the token's expiration, at + * autoRenewPeriod interval + */ + AccountID autoRenewAccount = 14; + + /** + * The interval at which the auto-renew account will be charged to extend the token's expiry + */ + Duration autoRenewPeriod = 15; + + /** + * The memo associated with the token (UTF-8 encoding max 100 bytes) + */ + string memo = 16; + + /** + * IWA compatibility. Specifies the token type. Defaults to FUNGIBLE_COMMON + */ + TokenType tokenType = 17; + + /** + * IWA compatibility. Specified the token supply type. Defaults to INFINITE + */ + TokenSupplyType supplyType = 18; + + /** + * IWA Compatibility. Depends on TokenSupplyType. For tokens of type FUNGIBLE_COMMON - the + * maximum number of tokens that can be in circulation. For tokens of type NON_FUNGIBLE_UNIQUE - + * the maximum number of NFTs (serial numbers) that can be minted. This field can never be + * changed! + */ + int64 maxSupply = 19; + + /** + * The key which can change the token's custom fee schedule; must sign a TokenFeeScheduleUpdate + * transaction + */ + Key fee_schedule_key = 20; + + /** + * The custom fees to be assessed during a CryptoTransfer that transfers units of this token + */ + repeated CustomFee custom_fees = 21; + + /** + * The Key which can pause and unpause the Token. + * If Empty the token pause status defaults to PauseNotApplicable, otherwise Unpaused. + */ + Key pause_key = 22; +} diff --git a/services/TokenDelete.proto b/services/token_delete.proto similarity index 60% rename from services/TokenDelete.proto rename to services/token_delete.proto index a849603a..cd4ba0a4 100644 --- a/services/TokenDelete.proto +++ b/services/token_delete.proto @@ -25,12 +25,19 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "BasicTypes.proto"; +import "basic_types.proto"; -/* - Marks a token as deleted, though it will remain in the ledger. - The operation must be signed by the specified Admin Key of the Token. If admin key is not set, Transaction will result in TOKEN_IS_IMMUTABlE. - Once deleted update, mint, burn, wipe, freeze, unfreeze, grant kyc, revoke kyc and token transfer transactions will resolve to TOKEN_WAS_DELETED. */ +/** + * Marks a token as deleted, though it will remain in the ledger. + * The operation must be signed by the specified Admin Key of the Token. If + * admin key is not set, Transaction will result in TOKEN_IS_IMMUTABlE. + * Once deleted update, mint, burn, wipe, freeze, unfreeze, grant kyc, revoke + * kyc and token transfer transactions will resolve to TOKEN_WAS_DELETED. + */ message TokenDeleteTransactionBody { - TokenID token = 1; // The token to be deleted. If invalid token is specified, transaction will result in INVALID_TOKEN_ID + /** + * The token to be deleted. If invalid token is specified, transaction will + * result in INVALID_TOKEN_ID + */ + TokenID token = 1; } diff --git a/services/token_dissociate.proto b/services/token_dissociate.proto new file mode 100644 index 00000000..e7d9d6d9 --- /dev/null +++ b/services/token_dissociate.proto @@ -0,0 +1,57 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Dissociates the provided account with the provided tokens. Must be signed by the provided + * Account's key. + * If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID. + * If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED. + * If any of the provided tokens is not found, the transaction will resolve to INVALID_TOKEN_REF. + * If any of the provided tokens has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. + * If an association between the provided account and any of the tokens does not exist, the + * transaction will resolve to TOKEN_NOT_ASSOCIATED_TO_ACCOUNT. + * If a token has not been deleted and has not expired, and the user has a nonzero balance, the + * transaction will resolve to TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES. + * If a fungible token has expired, the user can disassociate even if their token balance is + * not zero. + * If a non fungible token has expired, the user can not disassociate if their token + * balance is not zero. The transaction will resolve to TRANSACTION_REQUIRED_ZERO_TOKEN_BALANCES. + * On success, associations between the provided account and tokens are removed. + */ +message TokenDissociateTransactionBody { + /** + * The account to be dissociated with the provided tokens + */ + AccountID account = 1; + + /** + * The tokens to be dissociated with the provided account + */ + repeated TokenID tokens = 2; +} diff --git a/services/token_fee_schedule_update.proto b/services/token_fee_schedule_update.proto new file mode 100644 index 00000000..883d9cdf --- /dev/null +++ b/services/token_fee_schedule_update.proto @@ -0,0 +1,51 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "custom_fees.proto"; + +/** + * At consensus, updates a token type's fee schedule to the given list of custom fees. + * + * If the target token type has no fee_schedule_key, resolves to TOKEN_HAS_NO_FEE_SCHEDULE_KEY. + * Otherwise this transaction must be signed to the fee_schedule_key, or the transaction will + * resolve to INVALID_SIGNATURE. + * + * If the custom_fees list is empty, clears the fee schedule or resolves to + * CUSTOM_SCHEDULE_ALREADY_HAS_NO_FEES if the fee schedule was already empty. + */ +message TokenFeeScheduleUpdateTransactionBody { + /** + * The token whose fee schedule is to be updated + */ + TokenID token_id = 1; + + /** + * The new custom fees to be assessed during a CryptoTransfer that transfers units of this token + */ + repeated CustomFee custom_fees = 2; +} diff --git a/services/token_freeze_account.proto b/services/token_freeze_account.proto new file mode 100644 index 00000000..6c020783 --- /dev/null +++ b/services/token_freeze_account.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Freezes transfers of the specified token for the account. Must be signed by the Token's freezeKey. + * If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID. + * If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED. + * If the provided token is not found, the transaction will resolve to INVALID_TOKEN_ID. + * If the provided token has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. + * If an Association between the provided token and account is not found, the transaction will + * resolve to TOKEN_NOT_ASSOCIATED_TO_ACCOUNT. + * If no Freeze Key is defined, the transaction will resolve to TOKEN_HAS_NO_FREEZE_KEY. + * Once executed the Account is marked as Frozen and will not be able to receive or send tokens + * unless unfrozen. The operation is idempotent. + */ +message TokenFreezeAccountTransactionBody { + /** + * The token for which this account will be frozen. If token does not exist, transaction results + * in INVALID_TOKEN_ID + */ + TokenID token = 1; + + /** + * The account to be frozen + */ + AccountID account = 2; +} diff --git a/services/token_get_account_nft_infos.proto b/services/token_get_account_nft_infos.proto new file mode 100644 index 00000000..b7afbf79 --- /dev/null +++ b/services/token_get_account_nft_infos.proto @@ -0,0 +1,91 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "token_get_nft_info.proto"; +import "query_header.proto"; +import "response_header.proto"; + +/** + * Applicable only to tokens of type NON_FUNGIBLE_UNIQUE. Gets info on NFTs N through M owned by the + * specified accountId. + * Example: If Account A owns 5 NFTs (might be of different Token Entity), having start=0 and end=5 + * will return all of the NFTs + * + * INVALID_QUERY_RANGE response code will be returned if: + * 1) Start > End + * 2) Start and End indices are non-positive + * 3) Start and End indices are out of boundaries for the retrieved nft list + * 4) The range between Start and End is bigger than the global dynamic property for maximum query + * range + * + * NOT_SUPPORTED response code will be returned if the queried token is of type FUNGIBLE_COMMON + * + * INVALID_ACCOUNT_ID response code will be returned if the queried account does not exist + * + * ACCOUNT_DELETED response code will be returned if the queried account has been deleted + */ +message TokenGetAccountNftInfosQuery { + /** + * Standard info sent from client to node, including the signed payment, and what kind of + * response is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + /** + * The Account for which information is requested + */ + AccountID accountID = 2; + + /** + * Specifies the start index (inclusive) of the range of NFTs to query for. Value must be in the + * range [0; ownedNFTs-1] + */ + int64 start = 3; + + /** + * Specifies the end index (exclusive) of the range of NFTs to query for. Value must be in the + * range (start; ownedNFTs] + */ + int64 end = 4; +} + +/** + * UNDOCUMENTED + */ +message TokenGetAccountNftInfosResponse { + /** + * Standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither + */ + ResponseHeader header = 1; + + /** + * List of NFTs associated to the account + */ + repeated TokenNftInfo nfts = 2; +} diff --git a/services/token_get_info.proto b/services/token_get_info.proto new file mode 100644 index 00000000..df6c5eda --- /dev/null +++ b/services/token_get_info.proto @@ -0,0 +1,211 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "custom_fees.proto"; +import "query_header.proto"; +import "response_header.proto"; +import "timestamp.proto"; +import "duration.proto"; + +/** + * Gets information about Token instance + */ +message TokenGetInfoQuery { + /** + * Standard info sent from client to node, including the signed payment, and what kind of + * response is requested (cost, state proof, both, or neither) + */ + QueryHeader header = 1; + + /** + * The token for which information is requested. If invalid token is provided, INVALID_TOKEN_ID + * response is returned. + */ + TokenID token = 2; +} + +/** + * The metadata about a Token instance + */ +message TokenInfo { + /** + * ID of the token instance + */ + TokenID tokenId = 1; + + /** + * The name of the token. It is a string of ASCII only characters + */ + string name = 2; + + /** + * The symbol of the token. It is a UTF-8 capitalized alphabetical string + */ + string symbol = 3; + + /** + * The number of decimal places a token is divisible by. Always 0 for tokens of type + * NON_FUNGIBLE_UNIQUE + */ + uint32 decimals = 4; + + /** + * For tokens of type FUNGIBLE_COMMON - the total supply of tokens that are currently in + * circulation. For tokens of type NON_FUNGIBLE_UNIQUE - the number of NFTs created of this + * token instance + */ + uint64 totalSupply = 5; + + /** + * The ID of the account which is set as Treasury + */ + AccountID treasury = 6; + + /** + * The key which can perform update/delete operations on the token. If empty, the token can be + * perceived as immutable (not being able to be updated/deleted) + */ + Key adminKey = 7; + + /** + * The key which can grant or revoke KYC of an account for the token's transactions. If empty, + * KYC is not required, and KYC grant or revoke operations are not possible. + */ + Key kycKey = 8; + + /** + * The key which can freeze or unfreeze an account for token transactions. If empty, freezing is + * not possible + */ + Key freezeKey = 9; + + /** + * The key which can wipe token balance of an account. If empty, wipe is not possible + */ + Key wipeKey = 10; + + /** + * The key which can change the supply of a token. The key is used to sign Token Mint/Burn + * operations + */ + Key supplyKey = 11; + + /** + * The default Freeze status (not applicable, frozen or unfrozen) of Hedera accounts relative to + * this token. FreezeNotApplicable is returned if Token Freeze Key is empty. Frozen is returned + * if Token Freeze Key is set and defaultFreeze is set to true. Unfrozen is returned if Token + * Freeze Key is set and defaultFreeze is set to false + */ + TokenFreezeStatus defaultFreezeStatus = 12; + + /** + * The default KYC status (KycNotApplicable or Revoked) of Hedera accounts relative to this + * token. KycNotApplicable is returned if KYC key is not set, otherwise Revoked + */ + TokenKycStatus defaultKycStatus = 13; + + /** + * Specifies whether the token was deleted or not + */ + bool deleted = 14; + + /** + * An account which will be automatically charged to renew the token's expiration, at + * autoRenewPeriod interval + */ + AccountID autoRenewAccount = 15; + + /** + * The interval at which the auto-renew account will be charged to extend the token's expiry + */ + Duration autoRenewPeriod = 16; + + /** + * The epoch second at which the token will expire + */ + Timestamp expiry = 17; + + /** + * The memo associated with the token + */ + string memo = 18; + + /** + * The token type + */ + TokenType tokenType = 19; + + /** + * The token supply type + */ + TokenSupplyType supplyType = 20; + + /** + * For tokens of type FUNGIBLE_COMMON - The Maximum number of fungible tokens that can be in + * circulation. For tokens of type NON_FUNGIBLE_UNIQUE - the maximum number of NFTs (serial + * numbers) that can be in circulation + */ + int64 maxSupply = 21; + + /** + * The key which can change the custom fee schedule of the token; if not set, the fee schedule + * is immutable + */ + Key fee_schedule_key = 22; + + /** + * The custom fees to be assessed during a CryptoTransfer that transfers units of this token + */ + repeated CustomFee custom_fees = 23; + + /** + * The Key which can pause and unpause the Token. + */ + Key pause_key = 24; + + /** + * Specifies whether the token is paused or not. PauseNotApplicable is returned if pauseKey is not set. + */ + TokenPauseStatus pause_status = 25; +} + +/** + * Response when the client sends the node TokenGetInfoQuery + */ +message TokenGetInfoResponse { + /** + * Standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither + */ + ResponseHeader header = 1; + + /** + * The information requested about this token instance + */ + TokenInfo tokenInfo = 2; +} diff --git a/services/token_get_nft_info.proto b/services/token_get_nft_info.proto new file mode 100644 index 00000000..b6c4ecad --- /dev/null +++ b/services/token_get_nft_info.proto @@ -0,0 +1,104 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "query_header.proto"; +import "response_header.proto"; +import "timestamp.proto"; + +/** + * Represents an NFT on the Ledger + */ +message NftID { + /** + * The (non-fungible) token of which this NFT is an instance + */ + TokenID tokenID = 1; + + /** + * The unique identifier of this instance + */ + int64 serialNumber = 2; +} + +/** + * Applicable only to tokens of type NON_FUNGIBLE_UNIQUE. Gets info on a NFT for a given TokenID (of + * type NON_FUNGIBLE_UNIQUE) and serial number + */ +message TokenGetNftInfoQuery { + /** + * Standard info sent from client to node, including the signed payment, and what kind of + * response is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + /** + * The ID of the NFT + */ + NftID nftID = 2; +} + +/** + * UNDOCUMENTED + */ +message TokenNftInfo { + /** + * The ID of the NFT + */ + NftID nftID = 1; + + /** + * The current owner of the NFT + */ + AccountID accountID = 2; + + /** + * The effective consensus timestamp at which the NFT was minted + */ + Timestamp creationTime = 3; + + /** + * Represents the unique metadata of the NFT + */ + bytes metadata = 4; +} + +/** + * UNDOCUMENTED + */ +message TokenGetNftInfoResponse { + /** + * Standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither + */ + ResponseHeader header = 1; + + /** + * The information about this NFT + */ + TokenNftInfo nft = 2; +} diff --git a/services/token_get_nft_infos.proto b/services/token_get_nft_infos.proto new file mode 100644 index 00000000..07a74254 --- /dev/null +++ b/services/token_get_nft_infos.proto @@ -0,0 +1,91 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "token_get_nft_info.proto"; +import "query_header.proto"; +import "response_header.proto"; + +/** + * Applicable only to tokens of type NON_FUNGIBLE_UNIQUE. Gets info on NFTs N through M on the list + * of NFTs associated with a given NON_FUNGIBLE_UNIQUE Token. + * Example: If there are 10 NFTs issued, having start=0 and end=5 will query for the first 5 NFTs. + * Querying +all 10 NFTs will require start=0 and end=10 + * + * INVALID_QUERY_RANGE response code will be returned if: + * 1) Start > End + * 2) Start and End indices are non-positive + * 3) Start and End indices are out of boundaries for the retrieved nft list + * 4) The range between Start and End is bigger than the global dynamic property for maximum query + * range + * + * NOT_SUPPORTED response code will be returned if the queried token is of type FUNGIBLE_COMMON + * + * INVALID_TOKEN_ID response code will be returned if the queried token does not exist + */ +message TokenGetNftInfosQuery { + /** + * Standard info sent from client to node, including the signed payment, and what kind of + * response is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + /** + * The ID of the token for which information is requested + */ + TokenID tokenID = 2; + + /** + * Specifies the start index (inclusive) of the range of NFTs to query for. Value must be in the + * range [0; ownedNFTs-1] + */ + int64 start = 3; + + /** + * Specifies the end index (exclusive) of the range of NFTs to query for. Value must be in the + * range (start; ownedNFTs] + */ + int64 end = 4; +} + +message TokenGetNftInfosResponse { + /** + * Standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither + */ + ResponseHeader header = 1; + + /** + * The Token with type NON_FUNGIBLE that this record is for + */ + TokenID tokenID = 2; + + /** + * List of NFTs associated to the specified token + */ + repeated TokenNftInfo nfts = 3; +} diff --git a/services/token_grant_kyc.proto b/services/token_grant_kyc.proto new file mode 100644 index 00000000..de4dd4b1 --- /dev/null +++ b/services/token_grant_kyc.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Grants KYC to the account for the given token. Must be signed by the Token's kycKey. + * If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID. + * If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED. + * If the provided token is not found, the transaction will resolve to INVALID_TOKEN_ID. + * If the provided token has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. + * If an Association between the provided token and account is not found, the transaction will + * resolve to TOKEN_NOT_ASSOCIATED_TO_ACCOUNT. + * If no KYC Key is defined, the transaction will resolve to TOKEN_HAS_NO_KYC_KEY. + * Once executed the Account is marked as KYC Granted. + */ +message TokenGrantKycTransactionBody { + /** + * The token for which this account will be granted KYC. If token does not exist, transaction + * results in INVALID_TOKEN_ID + */ + TokenID token = 1; + + /** + * The account to be KYCed + */ + AccountID account = 2; +} diff --git a/services/token_mint.proto b/services/token_mint.proto new file mode 100644 index 00000000..c2091b67 --- /dev/null +++ b/services/token_mint.proto @@ -0,0 +1,66 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Mints tokens to the Token's treasury Account. If no Supply Key is defined, the transaction will + * resolve to TOKEN_HAS_NO_SUPPLY_KEY. + * The operation increases the Total Supply of the Token. The maximum total supply a token can have + * is 2^63-1. + * The amount provided must be in the lowest denomination possible. Example: + * Token A has 2 decimals. In order to mint 100 tokens, one must provide amount of 10000. In order + * to mint 100.55 tokens, one must provide amount of 10055. + * If both amount and metadata list get filled, a INVALID_TRANSACTION_BODY response code will be + * returned. + * If the metadata list contains metadata which is too large, a METADATA_TOO_LONG response code will + * be returned. + * If neither the amount nor the metadata list get filled, a INVALID_TOKEN_MINT_AMOUNT response code + * will be returned. + * If the metadata list count is greater than the batch size limit global dynamic property, a + * BATCH_SIZE_LIMIT_EXCEEDED response code will be returned. + */ +message TokenMintTransactionBody { + /** + * The token for which to mint tokens. If token does not exist, transaction results in + * INVALID_TOKEN_ID + */ + TokenID token = 1; + + /** + * Applicable to tokens of type FUNGIBLE_COMMON. The amount to mint to the Treasury Account. + * Amount must be a positive non-zero number represented in the lowest denomination of the + * token. The new supply must be lower than 2^63. + */ + uint64 amount = 2; + + /** + * Applicable to tokens of type NON_FUNGIBLE_UNIQUE. A list of metadata that are being created. + * Maximum allowed size of each metadata is 100 bytes + */ + repeated bytes metadata = 3; +} diff --git a/services/token_pause.proto b/services/token_pause.proto new file mode 100644 index 00000000..ca661f8d --- /dev/null +++ b/services/token_pause.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Pauses the Token from being involved in any kind of Transaction until it is unpaused. + * Must be signed with the Token's pause key. + * If the provided token is not found, the transaction will resolve to INVALID_TOKEN_ID. + * If the provided token has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. + * If no Pause Key is defined, the transaction will resolve to TOKEN_HAS_NO_PAUSE_KEY. + * Once executed the Token is marked as paused and will be not able to be a part of any transaction. + * The operation is idempotent - becomes a no-op if the Token is already Paused. + */ +message TokenPauseTransactionBody { + /** + * The token to be paused. + */ + TokenID token = 1; +} \ No newline at end of file diff --git a/services/token_revoke_kyc.proto b/services/token_revoke_kyc.proto new file mode 100644 index 00000000..61a120a4 --- /dev/null +++ b/services/token_revoke_kyc.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Revokes KYC to the account for the given token. Must be signed by the Token's kycKey. + * If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID. + * If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED. + * If the provided token is not found, the transaction will resolve to INVALID_TOKEN_ID. + * If the provided token has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. + * If an Association between the provided token and account is not found, the transaction will + * resolve to TOKEN_NOT_ASSOCIATED_TO_ACCOUNT. + * If no KYC Key is defined, the transaction will resolve to TOKEN_HAS_NO_KYC_KEY. + * Once executed the Account is marked as KYC Revoked + */ +message TokenRevokeKycTransactionBody { + /** + * The token for which this account will get his KYC revoked. If token does not exist, + * transaction results in INVALID_TOKEN_ID + */ + TokenID token = 1; + + /** + * The account to be KYC Revoked + */ + AccountID account = 2; +} diff --git a/services/token_service.proto b/services/token_service.proto new file mode 100644 index 00000000..c9652d25 --- /dev/null +++ b/services/token_service.proto @@ -0,0 +1,130 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.service.proto.java"; + +import "query.proto"; +import "response.proto"; +import "transaction_response.proto"; +import "transaction.proto"; + +/** + * Transactions and queries for the Token Service + */ +service TokenService { + /** + * Creates a new Token by submitting the transaction + */ + rpc createToken (Transaction) returns (TransactionResponse); + + /** + * Updates the account by submitting the transaction + */ + rpc updateToken (Transaction) returns (TransactionResponse); + + /** + * Mints an amount of the token to the defined treasury account + */ + rpc mintToken (Transaction) returns (TransactionResponse); + + /** + * Burns an amount of the token from the defined treasury account + */ + rpc burnToken (Transaction) returns (TransactionResponse); + + /** + * Deletes a Token + */ + rpc deleteToken (Transaction) returns (TransactionResponse); + + /** + * Wipes the provided amount of tokens from the specified Account ID + */ + rpc wipeTokenAccount (Transaction) returns (TransactionResponse); + + /** + * Freezes the transfer of tokens to or from the specified Account ID + */ + rpc freezeTokenAccount (Transaction) returns (TransactionResponse); + + /** + * Unfreezes the transfer of tokens to or from the specified Account ID + */ + rpc unfreezeTokenAccount (Transaction) returns (TransactionResponse); + + /** + * Flags the provided Account ID as having gone through KYC + */ + rpc grantKycToTokenAccount (Transaction) returns (TransactionResponse); + + /** + * Removes the KYC flag of the provided Account ID + */ + rpc revokeKycFromTokenAccount (Transaction) returns (TransactionResponse); + + /** + * Associates tokens to an account + */ + rpc associateTokens (Transaction) returns (TransactionResponse); + + /** + * Dissociates tokens from an account + */ + rpc dissociateTokens (Transaction) returns (TransactionResponse); + + /** + * Updates the custom fee schedule on a token + */ + rpc updateTokenFeeSchedule (Transaction) returns (TransactionResponse); + + /** + * Retrieves the metadata of a token + */ + rpc getTokenInfo (Query) returns (Response); + + /** + * (DEPRECATED) Gets info on NFTs N through M on the list of NFTs associated with a given account + */ + rpc getAccountNftInfos (Query) returns (Response) { + option deprecated = true; + }; + + /** + * Retrieves the metadata of an NFT by TokenID and serial number + */ + rpc getTokenNftInfo (Query) returns (Response); + + /** + * (DEPRECATED) Gets info on NFTs N through M on the list of NFTs associated with a given Token of type NON_FUNGIBLE + */ + rpc getTokenNftInfos (Query) returns (Response) { + option deprecated = true; + }; + + // Pause the token + rpc pauseToken (Transaction) returns (TransactionResponse); + + // Unpause the token + rpc unpauseToken (Transaction) returns (TransactionResponse); +} diff --git a/services/token_unfreeze_account.proto b/services/token_unfreeze_account.proto new file mode 100644 index 00000000..32d48600 --- /dev/null +++ b/services/token_unfreeze_account.proto @@ -0,0 +1,54 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Unfreezes transfers of the specified token for the account. Must be signed by the Token's + * freezeKey. + * If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID. + * If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED. + * If the provided token is not found, the transaction will resolve to INVALID_TOKEN_ID. + * If the provided token has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. + * If an Association between the provided token and account is not found, the transaction will + * resolve to TOKEN_NOT_ASSOCIATED_TO_ACCOUNT. + * If no Freeze Key is defined, the transaction will resolve to TOKEN_HAS_NO_FREEZE_KEY. + * Once executed the Account is marked as Unfrozen and will be able to receive or send tokens. The + * operation is idempotent. + */ +message TokenUnfreezeAccountTransactionBody { + /** + * The token for which this account will be unfrozen. If token does not exist, transaction + * results in INVALID_TOKEN_ID + */ + TokenID token = 1; + + /** + * The account to be unfrozen + */ + AccountID account = 2; +} diff --git a/services/token_unpause.proto b/services/token_unpause.proto new file mode 100644 index 00000000..183d5b30 --- /dev/null +++ b/services/token_unpause.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Unpauses the Token. Must be signed with the Token's pause key. + * If the provided token is not found, the transaction will resolve to INVALID_TOKEN_ID. + * If the provided token has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. + * If no Pause Key is defined, the transaction will resolve to TOKEN_HAS_NO_PAUSE_KEY. + * Once executed the Token is marked as Unpaused and can be used in Transactions. + * The operation is idempotent - becomes a no-op if the Token is already unpaused. + */ +message TokenUnpauseTransactionBody { + /** + * The token to be unpaused. + */ + TokenID token = 1; +} \ No newline at end of file diff --git a/services/token_update.proto b/services/token_update.proto new file mode 100644 index 00000000..41c3f80e --- /dev/null +++ b/services/token_update.proto @@ -0,0 +1,146 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +/** + * At consensus, updates an already created token to the given values. + * + * If no value is given for a field, that field is left unchanged. For an immutable tokens (that is, + * a token without an admin key), only the expiry may be updated. Setting any other field in that + * case will cause the transaction status to resolve to TOKEN_IS_IMMUTABLE. + * + * --- Signing Requirements --- + * 1. Whether or not a token has an admin key, its expiry can be extended with only the transaction + * payer's signature. + * 2. Updating any other field of a mutable token requires the admin key's signature. + * 3. If a new admin key is set, this new key must sign unless it is exactly an empty + * KeyList. This special sentinel key removes the existing admin key and causes the + * token to become immutable. (Other Key structures without a constituent + * Ed25519 key will be rejected with INVALID_ADMIN_KEY.) + * 4. If a new treasury is set, the new treasury account's key must sign the transaction. + * + * --- Nft Requirements --- + * 1. If a non fungible token has a positive treasury balance, the operation will abort with + * CURRENT_TREASURY_STILL_OWNS_NFTS. + */ +message TokenUpdateTransactionBody { + /** + * The Token to be updated + */ + TokenID token = 1; + + /** + * The new publicly visible Token symbol. The token name is specified as a Unicode string. + * Its UTF-8 encoding cannot exceed 100 bytes, and cannot contain the 0 byte (NUL). + * tokens.maxTokenNameUtf8Bytes. + */ + string symbol = 2; + + /** + * The new publicly visible name of the Token. The token symbol is specified as a Unicode string. + * Its UTF-8 encoding cannot exceed 100 bytes, and cannot contain the 0 byte (NUL). + * tokens.maxSymbolUtf8Bytes. + */ + string name = 3; + + /** + * The new Treasury account of the Token. If the provided treasury account is not existing or + * deleted, the response will be INVALID_TREASURY_ACCOUNT_FOR_TOKEN. If successful, the Token + * balance held in the previous Treasury Account is transferred to the new one. + */ + AccountID treasury = 4; + + /** + * The new admin key of the Token. If Token is immutable, transaction will resolve to + * TOKEN_IS_IMMUTABlE. + */ + Key adminKey = 5; + + /** + * The new KYC key of the Token. If Token does not have currently a KYC key, transaction will + * resolve to TOKEN_HAS_NO_KYC_KEY. + */ + Key kycKey = 6; + + /** + * The new Freeze key of the Token. If the Token does not have currently a Freeze key, + * transaction will resolve to TOKEN_HAS_NO_FREEZE_KEY. + */ + Key freezeKey = 7; + + /** + * The new Wipe key of the Token. If the Token does not have currently a Wipe key, transaction + * will resolve to TOKEN_HAS_NO_WIPE_KEY. + */ + Key wipeKey = 8; + + /** + * The new Supply key of the Token. If the Token does not have currently a Supply key, + * transaction will resolve to TOKEN_HAS_NO_SUPPLY_KEY. + */ + Key supplyKey = 9; + + /** + * The new account which will be automatically charged to renew the token's expiration, at + * autoRenewPeriod interval. + */ + AccountID autoRenewAccount = 10; + + /** + * The new interval at which the auto-renew account will be charged to extend the token's + * expiry. + */ + Duration autoRenewPeriod = 11; + + /** + * The new expiry time of the token. Expiry can be updated even if admin key is not set. If the + * provided expiry is earlier than the current token expiry, transaction wil resolve to + * INVALID_EXPIRATION_TIME + */ + Timestamp expiry = 12; + + /** + * If set, the new memo to be associated with the token (UTF-8 encoding max 100 bytes) + */ + google.protobuf.StringValue memo = 13; + + /** + * If set, the new key to use to update the token's custom fee schedule; if the token does not + * currently have this key, transaction will resolve to TOKEN_HAS_NO_FEE_SCHEDULE_KEY + */ + Key fee_schedule_key = 14; + + /** + * The Key which can pause and unpause the Token. If the Token does not currently have a pause key, + * transaction will resolve to TOKEN_HAS_NO_PAUSE_KEY + */ + Key pause_key = 15; +} diff --git a/services/token_wipe_account.proto b/services/token_wipe_account.proto new file mode 100644 index 00000000..357b1fdb --- /dev/null +++ b/services/token_wipe_account.proto @@ -0,0 +1,81 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Wipes the provided amount of tokens from the specified Account. Must be signed by the Token's + * Wipe key. + * If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID. + * If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED. + * If the provided token is not found, the transaction will resolve to INVALID_TOKEN_ID. + * If the provided token has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. + * If an Association between the provided token and account is not found, the transaction will + * resolve to TOKEN_NOT_ASSOCIATED_TO_ACCOUNT. + * If Wipe Key is not present in the Token, transaction results in TOKEN_HAS_NO_WIPE_KEY. + * If the provided account is the Token's Treasury Account, transaction results in + * CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT + * On success, tokens are removed from the account and the total supply of the token is decreased by + * the wiped amount. + * + * If both amount and serialNumbers get filled, a INVALID_TRANSACTION_BODY response code will be + * returned. + * If neither the amount nor the serialNumbers get filled, a INVALID_WIPING_AMOUNT response code + * will be returned. + * If the serialNumbers list contains a non-positive integer as a serial number, a INVALID_NFT_ID + * response code will be returned. + * If the serialNumbers' list count is greater than the batch size limit global dynamic property, a + * BATCH_SIZE_LIMIT_EXCEEDED response code will be returned. + * + * The amount provided is in the lowest denomination possible. Example: + * Token A has 2 decimals. In order to wipe 100 tokens from account, one must provide amount of + * 10000. In order to wipe 100.55 tokens, one must provide amount of 10055. + */ +message TokenWipeAccountTransactionBody { + /** + * The token for which the account will be wiped. If token does not exist, transaction results + * in INVALID_TOKEN_ID + */ + TokenID token = 1; + + /** + * The account to be wiped + */ + AccountID account = 2; + + /** + * Applicable to tokens of type FUNGIBLE_COMMON. The amount of tokens to wipe from the specified + * account. Amount must be a positive non-zero number in the lowest denomination possible, not + * bigger than the token balance of the account (0; balance] + */ + uint64 amount = 3; + + /** + * Applicable to tokens of type NON_FUNGIBLE_UNIQUE. The list of serial numbers to be wiped. + */ + repeated int64 serialNumbers = 4; +} diff --git a/services/transaction.proto b/services/transaction.proto new file mode 100644 index 00000000..e4fd6983 --- /dev/null +++ b/services/transaction.proto @@ -0,0 +1,68 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + + +import "duration.proto"; +import "basic_types.proto"; +import "transaction_body.proto"; + +/** + * A single signed transaction, including all its signatures. The SignatureList will have a + * Signature for each Key in the transaction, either explicit or implicit, in the order that they + * appear in the transaction. For example, a CryptoTransfer will first have a Signature + * corresponding to the Key for the paying account, followed by a Signature corresponding to the Key + * for each account that is sending or receiving cryptocurrency in the transfer. Each Transaction + * should not have more than 50 levels. + * The SignatureList field is deprecated and succeeded by SignatureMap. + */ +message Transaction { + /** + * the body of the transaction, which needs to be signed + */ + TransactionBody body = 1 [deprecated = true]; + + /** + * The signatures on the body, to authorize the transaction; deprecated and to be succeeded by + * SignatureMap field + */ + SignatureList sigs = 2 [deprecated = true]; + + /** + * The signatures on the body with the new format, to authorize the transaction + */ + SignatureMap sigMap = 3 [deprecated = true]; + + /** + * TransactionBody serialized into bytes, which needs to be signed + */ + bytes bodyBytes = 4 [deprecated = true]; + + /** + * SignedTransaction serialized into bytes + */ + bytes signedTransactionBytes = 5; +} diff --git a/services/transaction_body.proto b/services/transaction_body.proto new file mode 100644 index 00000000..87597f6c --- /dev/null +++ b/services/transaction_body.proto @@ -0,0 +1,318 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "system_delete.proto"; +import "system_undelete.proto"; +import "freeze.proto"; + +import "contract_call.proto"; +import "contract_create.proto"; +import "contract_update.proto"; + +import "crypto_add_live_hash.proto"; +import "crypto_create.proto"; +import "crypto_delete.proto"; +import "crypto_delete_live_hash.proto"; +import "crypto_transfer.proto"; +import "crypto_update.proto"; + +import "file_append.proto"; +import "file_create.proto"; +import "file_delete.proto"; +import "file_update.proto"; + +import "duration.proto"; +import "basic_types.proto"; +import "contract_delete.proto"; + +import "consensus_create_topic.proto"; +import "consensus_update_topic.proto"; +import "consensus_delete_topic.proto"; +import "consensus_submit_message.proto"; + +import "unchecked_submit.proto"; + +import "token_create.proto"; +import "token_freeze_account.proto"; +import "token_unfreeze_account.proto"; +import "token_grant_kyc.proto"; +import "token_revoke_kyc.proto"; +import "token_delete.proto"; +import "token_update.proto"; +import "token_mint.proto"; +import "token_burn.proto"; +import "token_wipe_account.proto"; +import "token_associate.proto"; +import "token_dissociate.proto"; +import "token_fee_schedule_update.proto"; +import "token_pause.proto"; +import "token_unpause.proto"; + +import "schedule_create.proto"; +import "schedule_delete.proto"; +import "schedule_sign.proto"; + +/** + * A single transaction. All transaction types are possible here. + */ +message TransactionBody { + /** + * The ID for this transaction, which includes the payer's account (the account paying the + * transaction fee). If two transactions have the same transactionID, they won't both have an + * effect + */ + TransactionID transactionID = 1; + + /** + * The account of the node that submits the client's transaction to the network + */ + AccountID nodeAccountID = 2; + + /** + * The maximum transaction fee the client is willing to pay + */ + uint64 transactionFee = 3; + + /** + * The transaction is invalid if consensusTimestamp > transactionID.transactionValidStart + + * transactionValidDuration + */ + Duration transactionValidDuration = 4; + + /** + * Should a record of this transaction be generated? (A receipt is always generated, but the + * record is optional) + */ + bool generateRecord = 5 [deprecated = true]; + + /** + * Any notes or descriptions that should be put into the record (max length 100) + */ + string memo = 6; + + oneof data { + /** + * Calls a function of a contract instance + */ + ContractCallTransactionBody contractCall = 7; + + /** + * Creates a contract instance + */ + ContractCreateTransactionBody contractCreateInstance = 8; + + /** + * Updates a contract + */ + ContractUpdateTransactionBody contractUpdateInstance = 9; + + /** + * Delete contract and transfer remaining balance into specified account + */ + ContractDeleteTransactionBody contractDeleteInstance = 22; + + /** + * Attach a new livehash to an account + */ + CryptoAddLiveHashTransactionBody cryptoAddLiveHash = 10; + + /** + * Create a new cryptocurrency account + */ + CryptoCreateTransactionBody cryptoCreateAccount = 11; + + /** + * Delete a cryptocurrency account (mark as deleted, and transfer hbars out) + */ + CryptoDeleteTransactionBody cryptoDelete = 12; + + /** + * Remove a livehash from an account + */ + CryptoDeleteLiveHashTransactionBody cryptoDeleteLiveHash = 13; + + /** + * Transfer amount between accounts + */ + CryptoTransferTransactionBody cryptoTransfer = 14; + + /** + * Modify information such as the expiration date for an account + */ + CryptoUpdateTransactionBody cryptoUpdateAccount = 15; + + /** + * Add bytes to the end of the contents of a file + */ + FileAppendTransactionBody fileAppend = 16; + + /** + * Create a new file + */ + FileCreateTransactionBody fileCreate = 17; + + /** + * Delete a file (remove contents and mark as deleted until it expires) + */ + FileDeleteTransactionBody fileDelete = 18; + + /** + * Modify information such as the expiration date for a file + */ + FileUpdateTransactionBody fileUpdate = 19; + + /** + * Hedera administrative deletion of a file or smart contract + */ + SystemDeleteTransactionBody systemDelete = 20; + + /** + * To undelete an entity deleted by SystemDelete + */ + SystemUndeleteTransactionBody systemUndelete = 21; + + /** + * Freeze the nodes + */ + FreezeTransactionBody freeze = 23; + + /** + * Creates a topic + */ + ConsensusCreateTopicTransactionBody consensusCreateTopic = 24; + + /** + * Updates a topic + */ + ConsensusUpdateTopicTransactionBody consensusUpdateTopic = 25; + + /** + * Deletes a topic + */ + ConsensusDeleteTopicTransactionBody consensusDeleteTopic = 26; + + /** + * Submits message to a topic + */ + ConsensusSubmitMessageTransactionBody consensusSubmitMessage = 27; + + /** + * UNDOCUMENTED + */ + UncheckedSubmitBody uncheckedSubmit = 28; + + /** + * Creates a token instance + */ + TokenCreateTransactionBody tokenCreation = 29; + + /** + * Freezes account not to be able to transact with a token + */ + TokenFreezeAccountTransactionBody tokenFreeze = 31; + + /** + * Unfreezes account for a token + */ + TokenUnfreezeAccountTransactionBody tokenUnfreeze = 32; + + /** + * Grants KYC to an account for a token + */ + TokenGrantKycTransactionBody tokenGrantKyc = 33; + + /** + * Revokes KYC of an account for a token + */ + TokenRevokeKycTransactionBody tokenRevokeKyc = 34; + + /** + * Deletes a token instance + */ + TokenDeleteTransactionBody tokenDeletion = 35; + + /** + * Updates a token instance + */ + TokenUpdateTransactionBody tokenUpdate = 36; + + /** + * Mints new tokens to a token's treasury account + */ + TokenMintTransactionBody tokenMint = 37; + + /** + * Burns tokens from a token's treasury account + */ + TokenBurnTransactionBody tokenBurn = 38; + + /** + * Wipes amount of tokens from an account + */ + TokenWipeAccountTransactionBody tokenWipe = 39; + + /** + * Associate tokens to an account + */ + TokenAssociateTransactionBody tokenAssociate = 40; + + /** + * Dissociate tokens from an account + */ + TokenDissociateTransactionBody tokenDissociate = 41; + + /** + * Updates a token's custom fee schedule + */ + TokenFeeScheduleUpdateTransactionBody token_fee_schedule_update = 45; + + /** + * Pauses the Token + */ + TokenPauseTransactionBody token_pause = 46; + + /** + * Unpauses the Token + */ + TokenUnpauseTransactionBody token_unpause = 47; + + /** + * Creates a schedule in the network's action queue + */ + ScheduleCreateTransactionBody scheduleCreate = 42; + + /** + * Deletes a schedule from the network's action queue + */ + ScheduleDeleteTransactionBody scheduleDelete = 43; + + /** + * Adds one or more Ed25519 keys to the affirmed signers of a scheduled transaction + */ + ScheduleSignTransactionBody scheduleSign = 44; + } +} diff --git a/services/TransactionContents.proto b/services/transaction_contents.proto similarity index 75% rename from services/TransactionContents.proto rename to services/transaction_contents.proto index 24d8b2c7..50e0c420 100644 --- a/services/TransactionContents.proto +++ b/services/transaction_contents.proto @@ -25,9 +25,16 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "BasicTypes.proto"; +import "basic_types.proto"; message SignedTransaction { - bytes bodyBytes = 1; // TransactionBody serialized into bytes, which needs to be signed - SignatureMap sigMap = 2; // The signatures on the body with the new format, to authorize the transaction + /** + * TransactionBody serialized into bytes, which needs to be signed + */ + bytes bodyBytes = 1; + + /** + * The signatures on the body with the new format, to authorize the transaction + */ + SignatureMap sigMap = 2; } diff --git a/services/transaction_get_fast_record.proto b/services/transaction_get_fast_record.proto new file mode 100644 index 00000000..fb75d8a2 --- /dev/null +++ b/services/transaction_get_fast_record.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "transaction_record.proto"; +import "basic_types.proto"; +import "query_header.proto"; +import "response_header.proto"; + +/** + * Get the tx record of a transaction, given its transaction ID. Once a transaction reaches + * consensus, then information about whether it succeeded or failed will be available until the end + * of the receipt period. Before and after the receipt period, and for a transaction that was never + * submitted, the receipt is unknown. This query is free (the payment field is left empty). + */ +message TransactionGetFastRecordQuery { + /** + * Standard info sent from client to node, including the signed payment, and what kind of + * response is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + /** + * The ID of the transaction for which the record is requested. + */ + TransactionID transactionID = 2; +} + +/** + * Response when the client sends the node TransactionGetFastRecordQuery. If it created a new entity + * (account, file, or smart contract instance) then one of the three ID fields will be filled in + * with the ID of the new entity. Sometimes a single transaction will create more than one new + * entity, such as when a new contract instance is created, and this also creates the new account + * that it owned by that instance. + */ +message TransactionGetFastRecordResponse { + /** + * Standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither + */ + ResponseHeader header = 1; + + /** + * The requested transaction records + */ + TransactionRecord transactionRecord = 2; +} diff --git a/services/transaction_get_receipt.proto b/services/transaction_get_receipt.proto new file mode 100644 index 00000000..c9633cb4 --- /dev/null +++ b/services/transaction_get_receipt.proto @@ -0,0 +1,100 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "transaction_receipt.proto"; +import "basic_types.proto"; +import "query_header.proto"; +import "response_header.proto"; + +/** + * Get the receipt of a transaction, given its transaction ID. Once a transaction reaches consensus, + * then information about whether it succeeded or failed will be available until the end of the + * receipt period. Before and after the receipt period, and for a transaction that was never + * submitted, the receipt is unknown. This query is free (the payment field is left empty). No + * State proof is available for this response + */ +message TransactionGetReceiptQuery { + /** + * Standard info sent from client to node, including the signed payment, and what kind of + * response is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + /** + * The ID of the transaction for which the receipt is requested. + */ + TransactionID transactionID = 2; + + /** + * Whether receipts of processing duplicate transactions should be returned along with the + * receipt of processing the first consensus transaction with the given id whose status was + * neither INVALID_NODE_ACCOUNT nor INVALID_PAYER_SIGNATURE; or, if no + * such receipt exists, the receipt of processing the first transaction to reach consensus with + * the given transaction id. + */ + bool includeDuplicates = 3; + + /** + * Whether the response should include the receipts of any child transactions spawned by the + * top-level transaction with the given transactionID. + */ + bool include_child_receipts = 4; +} + +/** + * Response when the client sends the node TransactionGetReceiptQuery. If it created a new entity + * (account, file, or smart contract instance) then one of the three ID fields will be filled in + * with the ID of the new entity. Sometimes a single transaction will create more than one new + * entity, such as when a new contract instance is created, and this also creates the new account + * that it owned by that instance. No State proof is available for this response + */ +message TransactionGetReceiptResponse { + /** + * Standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither + */ + ResponseHeader header = 1; + + /** + * Either the receipt of processing the first consensus transaction with the given id whose + * status was neither INVALID_NODE_ACCOUNT nor INVALID_PAYER_SIGNATURE; + * or, if no such receipt exists, the receipt of processing the first transaction to + * reach consensus with the given transaction id. + */ + TransactionReceipt receipt = 2; + + /** + * The receipts of processing all transactions with the given id, in consensus time order. + */ + repeated TransactionReceipt duplicateTransactionReceipts = 4; + + /** + * The receipts (if any) of all child transactions spawned by the transaction with the + * given top-level id, in consensus order. Always empty if the top-level status is UNKNOWN. + */ + repeated TransactionReceipt child_transaction_receipts = 5; +} diff --git a/services/transaction_get_record.proto b/services/transaction_get_record.proto new file mode 100644 index 00000000..1e9a045e --- /dev/null +++ b/services/transaction_get_record.proto @@ -0,0 +1,100 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "transaction_record.proto"; +import "basic_types.proto"; +import "query_header.proto"; +import "response_header.proto"; + +/** + * Get the record for a transaction. If the transaction requested a record, then the record lasts + * for one hour, and a state proof is available for it. If the transaction created an account, file, + * or smart contract instance, then the record will contain the ID for what it created. If the + * transaction called a smart contract function, then the record contains the result of that call. + * If the transaction was a cryptocurrency transfer, then the record includes the TransferList which + * gives the details of that transfer. If the transaction didn't return anything that should be in + * the record, then the results field will be set to nothing. + */ +message TransactionGetRecordQuery { + /** + * Standard info sent from client to node, including the signed payment, and what kind of + * response is requested (cost, state proof, both, or neither). + */ + QueryHeader header = 1; + + /** + * The ID of the transaction for which the record is requested. + */ + TransactionID transactionID = 2; + + /** + * Whether records of processing duplicate transactions should be returned along with the record + * of processing the first consensus transaction with the given id whose status was neither + * INVALID_NODE_ACCOUNT nor INVALID_PAYER_SIGNATURE; or, if no such + * record exists, the record of processing the first transaction to reach consensus with the + * given transaction id.. + */ + bool includeDuplicates = 3; + + /** + * Whether the response should include the records of any child transactions spawned by the + * top-level transaction with the given transactionID. + */ + bool include_child_records = 4; +} + +/** + * Response when the client sends the node TransactionGetRecordQuery + */ +message TransactionGetRecordResponse { + /** + * Standard response from node to client, including the requested fields: cost, or state proof, + * or both, or neither. + */ + ResponseHeader header = 1; + + /** + * Either the record of processing the first consensus transaction with the given id whose + * status was neither INVALID_NODE_ACCOUNT nor INVALID_PAYER_SIGNATURE; + * or, if no such record exists, the record of processing the first transaction to reach + * consensus with the given transaction id. + */ + TransactionRecord transactionRecord = 3; + + /** + * The records of processing all consensus transaction with the same id as the distinguished + * record above, in chronological order. + */ + repeated TransactionRecord duplicateTransactionRecords = 4; + + /** + * The records of processing all child transaction spawned by the transaction with the given + * top-level id, in consensus order. Always empty if the top-level status is UNKNOWN. + */ + repeated TransactionRecord child_transaction_records = 5; +} + diff --git a/services/transaction_receipt.proto b/services/transaction_receipt.proto new file mode 100644 index 00000000..0a59e1d8 --- /dev/null +++ b/services/transaction_receipt.proto @@ -0,0 +1,166 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "response_code.proto"; +import "exchange_rate.proto"; + +/** + * The summary of a transaction's result so far. If the transaction has not reached consensus, this + * result will be necessarily incomplete. + */ +message TransactionReceipt { + /** + * The consensus status of the transaction; is UNKNOWN if consensus has not been reached, or if + * the associated transaction did not have a valid payer signature + */ + ResponseCodeEnum status = 1; + + /** + * In the receipt of a CryptoCreate, the id of the newly created account + */ + AccountID accountID = 2; + + /** + * In the receipt of a FileCreate, the id of the newly created file + */ + FileID fileID = 3; + + /** + * In the receipt of a ContractCreate, the id of the newly created contract + */ + ContractID contractID = 4; + + /** + * The exchange rates in effect when the transaction reached consensus + */ + ExchangeRateSet exchangeRate = 5; + + /** + * In the receipt of a ConsensusCreateTopic, the id of the newly created topic. + */ + TopicID topicID = 6; + + /** + * In the receipt of a ConsensusSubmitMessage, the new sequence number of the topic that + * received the message + */ + uint64 topicSequenceNumber = 7; + + /** + * In the receipt of a ConsensusSubmitMessage, the new running hash of the topic that received + * the message. This 48-byte field is the output of a particular SHA-384 digest whose input + * data are determined by the value of the topicRunningHashVersion below. The bytes of each + * uint64 or uint32 are to be in Big-Endian format. + * + * IF the topicRunningHashVersion is '0' or '1', then the input data to the SHA-384 digest are, + * in order: + * --- + * 1. The previous running hash of the topic (48 bytes) + * 2. The topic's shard (8 bytes) + * 3. The topic's realm (8 bytes) + * 4. The topic's number (8 bytes) + * 5. The number of seconds since the epoch before the ConsensusSubmitMessage reached + * consensus (8 bytes) + * 6. The number of nanoseconds since 5. before the ConsensusSubmitMessage reached + * consensus (4 bytes) + * 7. The topicSequenceNumber from above (8 bytes) + * 8. The message bytes from the ConsensusSubmitMessage (variable). + * + * IF the topicRunningHashVersion is '2', then the input data to the SHA-384 digest are, in + * order: + * --- + * 1. The previous running hash of the topic (48 bytes) + * 2. The topicRunningHashVersion below (8 bytes) + * 3. The topic's shard (8 bytes) + * 4. The topic's realm (8 bytes) + * 5. The topic's number (8 bytes) + * 6. The number of seconds since the epoch before the ConsensusSubmitMessage reached + * consensus (8 bytes) + * 7. The number of nanoseconds since 6. before the ConsensusSubmitMessage reached + * consensus (4 bytes) + * 8. The topicSequenceNumber from above (8 bytes) + * 9. The output of the SHA-384 digest of the message bytes from the + * consensusSubmitMessage (48 bytes) + * + * Otherwise, IF the topicRunningHashVersion is '3', then the input data to the SHA-384 digest + * are, in order: + * --- + * 1. The previous running hash of the topic (48 bytes) + * 2. The topicRunningHashVersion below (8 bytes) + * 3. The payer account's shard (8 bytes) + * 4. The payer account's realm (8 bytes) + * 5. The payer account's number (8 bytes) + * 6. The topic's shard (8 bytes) + * 7. The topic's realm (8 bytes) + * 8. The topic's number (8 bytes) + * 9. The number of seconds since the epoch before the ConsensusSubmitMessage reached + * consensus (8 bytes) + * 10. The number of nanoseconds since 9. before the ConsensusSubmitMessage reached + * consensus (4 bytes) + * 11. The topicSequenceNumber from above (8 bytes) + * 12. The output of the SHA-384 digest of the message bytes from the + * consensusSubmitMessage (48 bytes) + */ + bytes topicRunningHash = 8; + + /** + * In the receipt of a ConsensusSubmitMessage, the version of the SHA-384 digest used to update + * the running hash. + */ + uint64 topicRunningHashVersion = 9; + + /** + * In the receipt of a CreateToken, the id of the newly created token + */ + TokenID tokenID = 10; + + /** + * In the receipt of TokenMint, TokenWipe, TokenBurn, For fungible tokens - the current total + * supply of this token. For non fungible tokens - the total number of NFTs issued for a given + * tokenID + */ + uint64 newTotalSupply = 11; + + /** + * In the receipt of a ScheduleCreate, the id of the newly created Scheduled Entity + */ + ScheduleID scheduleID = 12; + + /** + * In the receipt of a ScheduleCreate or ScheduleSign that resolves to SUCCESS, the + * TransactionID that should be used to query for the receipt or record of the relevant + * scheduled transaction + */ + TransactionID scheduledTransactionID = 13; + + /** + * In the receipt of a TokenMint for tokens of type NON_FUNGIBLE_UNIQUE, the serial numbers of + * the newly created NFTs + */ + repeated int64 serialNumbers = 14; +} diff --git a/services/transaction_record.proto b/services/transaction_record.proto new file mode 100644 index 00000000..9781c69c --- /dev/null +++ b/services/transaction_record.proto @@ -0,0 +1,125 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "timestamp.proto"; +import "basic_types.proto"; +import "custom_fees.proto"; +import "transaction_receipt.proto"; +import "crypto_transfer.proto"; +import "contract_call_local.proto"; + +/** + * Response when the client sends the node TransactionGetRecordResponse + */ +message TransactionRecord { + /** + * The status (reach consensus, or failed, or is unknown) and the ID of any new + * account/file/instance created. + */ + TransactionReceipt receipt = 1; + + /** + * The hash of the Transaction that executed (not the hash of any Transaction that failed for + * having a duplicate TransactionID) + */ + bytes transactionHash = 2; + + /** + * The consensus timestamp (or null if didn't reach consensus yet) + */ + Timestamp consensusTimestamp = 3; + + /** + * The ID of the transaction this record represents + */ + TransactionID transactionID = 4; + + /** + * The memo that was submitted as part of the transaction (max 100 bytes) + */ + string memo = 5; + + /** + * The actual transaction fee charged, not the original transactionFee value from + * TransactionBody + */ + uint64 transactionFee = 6; + + oneof body { + /** + * Record of the value returned by the smart contract function (if it completed and didn't + * fail) from ContractCallTransaction + */ + ContractFunctionResult contractCallResult = 7; + + /** + * Record of the value returned by the smart contract constructor (if it completed and + * didn't fail) from ContractCreateTransaction + */ + ContractFunctionResult contractCreateResult = 8; + } + + /** + * All hbar transfers as a result of this transaction, such as fees, or transfers performed by + * the transaction, or by a smart contract it calls, or by the creation of threshold records + * that it triggers. + */ + TransferList transferList = 10; + + /** + * All Token transfers as a result of this transaction + */ + repeated TokenTransferList tokenTransferLists = 11; + + /** + * Reference to the scheduled transaction ID that this transaction record represent + */ + ScheduleID scheduleRef = 12; + + /** + * All custom fees that were assessed during a CryptoTransfer, and must be paid if the + * transaction status resolved to SUCCESS + */ + repeated AssessedCustomFee assessed_custom_fees = 13; + + /** + * All token associations implicitly created while handling this transaction + */ + repeated TokenAssociation automatic_token_associations = 14; + + /** + * In the record of an internal transaction, the consensus timestamp of the user + * transaction that spawned it. + */ + Timestamp parent_consensus_timestamp = 15; + + /** + * In the record of an internal CryptoCreate transaction triggered by a user + * transaction with a (previously unused) alias, the new account's alias. + */ + bytes alias = 16; +} diff --git a/services/TransactionResponse.proto b/services/transaction_response.proto similarity index 51% rename from services/TransactionResponse.proto rename to services/transaction_response.proto index 542e261d..38061cf3 100644 --- a/services/TransactionResponse.proto +++ b/services/transaction_response.proto @@ -25,11 +25,25 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -import "ResponseCode.proto"; +import "response_code.proto"; -/* When the client sends the node a transaction of any kind, the node replies with this, which simply says that the transaction passed the precheck (so the node will submit it to the network) or it failed (so it won't). If the fee offered was insufficient, this will also contain the amount of the required fee. To learn the consensus result, the client should later obtain a receipt (free), or can buy a more detailed record (not free). */ +/** + * When the client sends the node a transaction of any kind, the node replies with this, which + * simply says that the transaction passed the precheck (so the node will submit it to the network) + * or it failed (so it won't). If the fee offered was insufficient, this will also contain the + * amount of the required fee. To learn the consensus result, the client should later obtain a + * receipt (free), or can buy a more detailed record (not free). + */ message TransactionResponse { - ResponseCodeEnum nodeTransactionPrecheckCode = 1; // The response code that indicates the current status of the transaction. - uint64 cost = 2; // If the response code was INSUFFICIENT_TX_FEE, the actual transaction fee that would be required to execute the transaction. + /** + * The response code that indicates the current status of the transaction. + */ + ResponseCodeEnum nodeTransactionPrecheckCode = 1; + + /** + * If the response code was INSUFFICIENT_TX_FEE, the actual transaction fee that would be + * required to execute the transaction. + */ + uint64 cost = 2; } diff --git a/services/UncheckedSubmit.proto b/services/unchecked_submit.proto similarity index 76% rename from services/UncheckedSubmit.proto rename to services/unchecked_submit.proto index 00c6e812..d3311614 100644 --- a/services/UncheckedSubmit.proto +++ b/services/unchecked_submit.proto @@ -25,9 +25,13 @@ package proto; option java_package = "com.hederahashgraph.api.proto.java"; option java_multiple_files = true; -/* -Submit an arbitrary (serialized) Transaction to the network without prechecks. Requires superuser privileges. -*/ +/** + * Submit an arbitrary (serialized) Transaction to the network without prechecks. Requires superuser + * privileges. + */ message UncheckedSubmitBody { - bytes transactionBytes = 1; // The serialized bytes of the Transaction to be submitted without prechecks + /** + * The serialized bytes of the Transaction to be submitted without prechecks + */ + bytes transactionBytes = 1; } diff --git a/streams/AccountBalanceFile.proto b/streams/AccountBalanceFile.proto deleted file mode 100644 index bc73f947..00000000 --- a/streams/AccountBalanceFile.proto +++ /dev/null @@ -1,47 +0,0 @@ -syntax = "proto3"; - -package proto; - -/*- - * ‌ - * Hedera Network Services Protobuf - * ​ - * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC - * ​ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ‍ - */ - -option java_package = "com.hedera.services.stream.proto"; -option java_multiple_files = true; - -import "BasicTypes.proto"; -import "Timestamp.proto"; - -message TokenUnitBalance { - TokenID tokenId = 1; // A unique token id - uint64 balance = 2; // Number of transferable units of the identified token. For token of type FUNGIBLE_COMMON - balance in the smallest denomination. For token of type NON_FUNGIBLE_UNIQUE - the number of NFTs held by the account -} - -/* Includes all currency balances (both hbar and token) of a single account in the ledger. */ -message SingleAccountBalances { - AccountID accountID = 1; // The account - uint64 hbarBalance = 2; // The account's hbar balance - repeated TokenUnitBalance tokenUnitBalances = 3; // The list of the account's token balances -} - -/* Includes all currency balances (both hbar and token) of all accounts in the ledger. */ -message AllAccountBalances { - Timestamp consensusTimestamp = 1; // An instant in consensus time - repeated SingleAccountBalances allAccounts = 2; // The list of account balances for all accounts, after handling all transactions with consensus timestamp up to and including the above instant -} diff --git a/streams/account_balance_file.proto b/streams/account_balance_file.proto new file mode 100644 index 00000000..4c589080 --- /dev/null +++ b/streams/account_balance_file.proto @@ -0,0 +1,79 @@ +syntax = "proto3"; + +package proto; + +/*- + * ‌ + * Hedera Network Services Protobuf + * ​ + * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC + * ​ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ‍ + */ + +option java_package = "com.hedera.services.stream.proto"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "timestamp.proto"; + +message TokenUnitBalance { + /** + * A unique token id + */ + TokenID tokenId = 1; + + /** + * Number of transferable units of the identified token. For token of type FUNGIBLE_COMMON - + * balance in the smallest denomination. For token of type NON_FUNGIBLE_UNIQUE - the number of + * NFTs held by the account + */ + uint64 balance = 2; +} + +/** + * Includes all currency balances (both hbar and token) of a single account in the ledger. + */ +message SingleAccountBalances { + /** + * The account + */ + AccountID accountID = 1; + + /** + * The account's hbar balance + */ + uint64 hbarBalance = 2; + + /** + * The list of the account's token balances + */ + repeated TokenUnitBalance tokenUnitBalances = 3; +} + +/** + * Includes all currency balances (both hbar and token) of all accounts in the ledger. + */ +message AllAccountBalances { + /** + * An instant in consensus time + */ + Timestamp consensusTimestamp = 1; + + /** + * The list of account balances for all accounts, after handling all transactions with consensus + * timestamp up to and including the above instant + */ + repeated SingleAccountBalances allAccounts = 2; +} From 9245070991f3b9ef62dd61e7d85f5a9e69adc814 Mon Sep 17 00:00:00 2001 From: anighanta Date: Tue, 4 Jan 2022 20:01:05 +0530 Subject: [PATCH 4/5] fix typos Signed-off-by: anighanta --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dc73cd6a..882c250b 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ controlled by one (or more) Ed25519 keypairs: 1. The [cryptocurrency service](services/crypto_service.proto), for cryptocurrency accounts with transfers denominated in [hBar (ℏ)](https://help.hedera.com/hc/en-us/articles/360000674317-What-are-the-official-HBAR-cryptocurrency-denominations-). -2. The [consensus service](services/consensus_ervice.proto), for +2. The [consensus service](services/consensus_service.proto), for fast and unbiased ordering of opaque binary messages exchanged on arbitrary topics. 3. The [smart contract service](services/smart_contract_service.proto), for @@ -23,11 +23,11 @@ retrieval of opaque binary data. 5. The [token service](services/token_service.proto), for token related operations such as create, update, mint, burn, transfer etc. There are also three secondary service families: -1. The [network service](hedera/network_service.proto), for operations scoped +1. The [network service](services/network_service.proto), for operations scoped to the network or its constituent nodes rather user-controlled entities as above. 2. The [scheduling service](services/schedule_service.proto), for scheduling a transaction to be executed when the ledger has received enough prequisite signatures. -3. The [freeze service](hedera/freeze_service.proto), for use by +3. The [freeze service](services/freeze_service.proto), for use by privileged accounts to suspend network operations during a maintenance window. It is important to note that most network services are gated by fees which From b3ed7b9ea6e32e11ed85294ec72df3348b75b100 Mon Sep 17 00:00:00 2001 From: anighanta Date: Mon, 10 Jan 2022 20:27:01 +0530 Subject: [PATCH 5/5] use ECDSA(secp256k1) to describe newly supported keys Signed-off-by: anighanta --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 882c250b..2e17069f 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ privileged accounts to suspend network operations during a maintenance window. It is important to note that most network services are gated by fees which must be paid in ℏ from a cryptocurrency account. The payer authorizes a fee by signing an appropriate transaction with a sufficient subset of the -Ed25519/ECDSA_SECP256K1 key(s) associated to their account. +Ed25519/ECDSA(secp256k1) key(s) associated to their account. # Branching This repository uses a simple branching model with only two distinguished branches: