From 439cc995105a1a4d41f27671df543309bdfa924d Mon Sep 17 00:00:00 2001 From: Neeharika-Sompalli Date: Fri, 11 Sep 2020 15:21:58 -0500 Subject: [PATCH 1/5] deprecate protobufs threshold records --- hapi-proto/src/main/proto/CryptoCreate.proto | 4 ++-- hapi-proto/src/main/proto/CryptoGetInfo.proto | 4 ++-- hapi-proto/src/main/proto/ResponseCode.proto | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hapi-proto/src/main/proto/CryptoCreate.proto b/hapi-proto/src/main/proto/CryptoCreate.proto index 38d280c127c2..8c27b556e950 100644 --- a/hapi-proto/src/main/proto/CryptoCreate.proto +++ b/hapi-proto/src/main/proto/CryptoCreate.proto @@ -39,8 +39,8 @@ 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; // The threshold amount (in tinybars) for which an account record is created for any send/withdraw transaction - uint64 receiveRecordThreshold = 7; // The threshold amount (in tinybars) for which an account record is created for any receive/deposit transaction + uint64 sendRecordThreshold = 6 [deprecated=true]; // The threshold amount (in tinybars) for which an account record is created for any send/withdraw transaction + uint64 receiveRecordThreshold = 7 [deprecated=true]; // 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 diff --git a/hapi-proto/src/main/proto/CryptoGetInfo.proto b/hapi-proto/src/main/proto/CryptoGetInfo.proto index d08bd63ea35a..3859afb2f1c8 100644 --- a/hapi-proto/src/main/proto/CryptoGetInfo.proto +++ b/hapi-proto/src/main/proto/CryptoGetInfo.proto @@ -51,9 +51,9 @@ message CryptoGetInfoResponse { 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 // 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; + uint64 generateSendRecordThreshold = 9 [deprecated=true]; // 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; + 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. diff --git a/hapi-proto/src/main/proto/ResponseCode.proto b/hapi-proto/src/main/proto/ResponseCode.proto index ad88a7a5f5f2..4b5688b8e746 100644 --- a/hapi-proto/src/main/proto/ResponseCode.proto +++ b/hapi-proto/src/main/proto/ResponseCode.proto @@ -133,8 +133,8 @@ enum ResponseCodeEnum { 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; // attempt to set negative receive record threshold - INVALID_SEND_RECORD_THRESHOLD=87; // attempt to set negative send record threshold + INVALID_RECEIVE_RECORD_THRESHOLD=86 [deprecated=true]; // attempt to set negative receive record threshold + INVALID_SEND_RECORD_THRESHOLD=87 [deprecated=true]; // 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 From de165f4b6be85b8098f65becf689c38934b7175f Mon Sep 17 00:00:00 2001 From: Neeharika-Sompalli Date: Fri, 11 Sep 2020 15:59:27 -0500 Subject: [PATCH 2/5] remove creation of threshold records --- .../fees/charging/ItemizableFeeCharging.java | 7 --- .../services/stats/HederaNodeStats.java | 1 + .../records/FeeChargingRecordsHistorian.java | 43 ++----------------- 3 files changed, 4 insertions(+), 47 deletions(-) diff --git a/hedera-node/src/main/java/com/hedera/services/fees/charging/ItemizableFeeCharging.java b/hedera-node/src/main/java/com/hedera/services/fees/charging/ItemizableFeeCharging.java index 6e1efb6431ba..3b5deff6841a 100644 --- a/hedera-node/src/main/java/com/hedera/services/fees/charging/ItemizableFeeCharging.java +++ b/hedera-node/src/main/java/com/hedera/services/fees/charging/ItemizableFeeCharging.java @@ -144,13 +144,6 @@ public TransferList itemizedFees() { includeIfCharged(CACHE_RECORD, payer, payerFeesCharged, fees); } - if (!thresholdFeePayers.isEmpty()) { - long thresholdRecordFee = feeAmounts.get(THRESHOLD_RECORD); - thresholdFeePayers.stream() - .sorted(HederaLedger.ACCOUNT_ID_COMPARATOR) - .forEach(id -> fees.addAllAccountAmounts(receiverFirst(id, funding, thresholdRecordFee))); - } - return fees.build(); } diff --git a/hedera-node/src/main/java/com/hedera/services/legacy/services/stats/HederaNodeStats.java b/hedera-node/src/main/java/com/hedera/services/legacy/services/stats/HederaNodeStats.java index c81ec5bfbfcf..2089ee111408 100644 --- a/hedera-node/src/main/java/com/hedera/services/legacy/services/stats/HederaNodeStats.java +++ b/hedera-node/src/main/java/com/hedera/services/legacy/services/stats/HederaNodeStats.java @@ -51,6 +51,7 @@ public class HederaNodeStats { private static final double DEFAULT_HALF_LIFE = 10.0; public static final int UPDATE_PERIOD = 3000; + @Deprecated private static final String THRESHOLD_RECORDS_IN_STATE = "thresholdRecInState"; private final Logger log; diff --git a/hedera-node/src/main/java/com/hedera/services/records/FeeChargingRecordsHistorian.java b/hedera-node/src/main/java/com/hedera/services/records/FeeChargingRecordsHistorian.java index 4ae79a731136..e68463f821af 100644 --- a/hedera-node/src/main/java/com/hedera/services/records/FeeChargingRecordsHistorian.java +++ b/hedera-node/src/main/java/com/hedera/services/records/FeeChargingRecordsHistorian.java @@ -35,12 +35,12 @@ import com.hederahashgraph.api.proto.java.TransactionRecord; import com.swirlds.fcmap.FCMap; +import java.util.HashSet; import java.util.Optional; import java.util.Set; import java.util.function.Supplier; import static com.hedera.services.fees.TxnFeeType.CACHE_RECORD; -import static com.hedera.services.fees.TxnFeeType.THRESHOLD_RECORD; import static com.hedera.services.fees.charging.ItemizableFeeCharging.CACHE_RECORD_FEE; import static com.hedera.services.fees.charging.ItemizableFeeCharging.THRESHOLD_RECORD_FEE; import static com.hedera.services.state.merkle.MerkleEntityId.fromAccountId; @@ -102,11 +102,7 @@ public void addNewRecords() { var record = txnCtx.recordSoFar(); long cachingFeePaid = payForCaching(record); - long thresholdRecordFee = fees.computeStorageFee(record); - Set qualifiers = getThreshXQualifiers(thresholdRecordFee); - feeCharging.setFor(THRESHOLD_RECORD, thresholdRecordFee); - payForThresholdRecords(qualifiers); - if (feeCharging.numThresholdFeesCharged() > 0 || cachingFeePaid > 0L) { + if ( cachingFeePaid > 0L) { record = txnCtx.updatedRecordGiven(ledger.netTransfersInTxn()); } @@ -114,6 +110,7 @@ record = txnCtx.updatedRecordGiven(ledger.netTransfersInTxn()); long now = txnCtx.consensusTime().getEpochSecond(); long submittingMember = txnCtx.submittingSwirldsMember(); + Set qualifiers = new HashSet<>(); addNonThreshXQualifiers(record, qualifiers); if (!qualifiers.isEmpty()) { createHistorical(qualifiers, record, now, submittingMember); @@ -140,40 +137,6 @@ public void reviewExistingRecords() { expiries.resumeTrackingFrom(accounts.get()); } - private boolean qualifiesForRecord(AccountAmount adjustment, long recordFee) { - AccountID id = adjustment.getAccountID(); - if (ledger.isPendingCreation(id)) { - return false; - } - long balance = ledger.getBalance(id); - if (balance < recordFee) { - return false; - } - - long amount = adjustment.getAmount(); - return checkIfAmountUnderThreshold(amount, id); - } - - private boolean checkIfAmountUnderThreshold(long amount, AccountID id) { - if (amount < 0) { - return -1 * amount > ledger.fundsSentRecordThreshold(id); - } else { - return amount > ledger.fundsReceivedRecordThreshold(id); - } - } - - private void payForThresholdRecords(Set ids) { - ids.forEach(id -> feeCharging.chargeParticipant(id, THRESHOLD_RECORD_FEE)); - } - - private Set getThreshXQualifiers(long recordFee) { - return ledger.netTransfersInTxn().getAccountAmountsList() - .stream() - .filter(aa -> qualifiesForRecord(aa, recordFee)) - .map(AccountAmount::getAccountID) - .collect(toSet()); - } - private void createHistorical( Set ids, TransactionRecord record, From 975aecc065734625efb4042ebd282da2456af04d Mon Sep 17 00:00:00 2001 From: Neeharika-Sompalli Date: Mon, 14 Sep 2020 11:18:30 -0500 Subject: [PATCH 3/5] remove code changes --- .../charging/FieldSourcedFeeScreening.java | 3 ++ .../fees/charging/ItemizableFeeCharging.java | 28 +++++++----- .../services/stats/HederaNodeStats.java | 1 - .../records/FeeChargingRecordsHistorian.java | 44 ++++++++++++++++++- 4 files changed, 64 insertions(+), 12 deletions(-) diff --git a/hedera-node/src/main/java/com/hedera/services/fees/charging/FieldSourcedFeeScreening.java b/hedera-node/src/main/java/com/hedera/services/fees/charging/FieldSourcedFeeScreening.java index 41b31ca45817..f68c753f11d9 100644 --- a/hedera-node/src/main/java/com/hedera/services/fees/charging/FieldSourcedFeeScreening.java +++ b/hedera-node/src/main/java/com/hedera/services/fees/charging/FieldSourcedFeeScreening.java @@ -83,6 +83,9 @@ protected boolean isPayerExempt() { @Override public boolean canParticipantAfford(AccountID participant, EnumSet fees) { long exemptAmount = 0; + if (fees.contains(THRESHOLD_RECORD)) { + exemptAmount += exemptions.isExemptFromRecordFees(participant) ? feeAmounts.get(THRESHOLD_RECORD) : 0; + } long netAmount = totalAmountOf(fees) - exemptAmount; return check.canAfford(participant, netAmount); } diff --git a/hedera-node/src/main/java/com/hedera/services/fees/charging/ItemizableFeeCharging.java b/hedera-node/src/main/java/com/hedera/services/fees/charging/ItemizableFeeCharging.java index 6536a344e467..482fbcb0be9d 100644 --- a/hedera-node/src/main/java/com/hedera/services/fees/charging/ItemizableFeeCharging.java +++ b/hedera-node/src/main/java/com/hedera/services/fees/charging/ItemizableFeeCharging.java @@ -144,6 +144,13 @@ public TransferList itemizedFees() { includeIfCharged(CACHE_RECORD, payer, payerFeesCharged, fees); } + if (!thresholdFeePayers.isEmpty()) { + long thresholdRecordFee = feeAmounts.get(THRESHOLD_RECORD); + thresholdFeePayers.stream() + .sorted(HederaLedger.ACCOUNT_ID_COMPARATOR) + .forEach(id -> fees.addAllAccountAmounts(receiverFirst(id, funding, thresholdRecordFee))); + } + return fees.build(); } @@ -166,11 +173,9 @@ private void includeIfCharged( private List receiverFirst(AccountID payer, AccountID receiver, long amount) { return itemized(payer, receiver, amount, true); } - private List senderFirst(AccountID payer, AccountID receiver, long amount) { return itemized(payer, receiver, amount, false); } - private List itemized(AccountID payer, AccountID receiver, long amount, boolean isReceiverFirst) { return List.of( AccountAmount.newBuilder() @@ -187,8 +192,7 @@ private List itemized(AccountID payer, AccountID receiver, long a public void chargeSubmittingNodeUpTo(EnumSet fees) { pay( fees, - () -> { - }, + () -> {}, (fee) -> chargeUpTo(submittingNode, funding, fee)); } @@ -247,7 +251,7 @@ private void chargeUpTo(AccountID payer, AccountID payee, TxnFeeType fee) { } private void completeNonVanishing(AccountID payer, AccountID payee, long amount, TxnFeeType fee) { - if (amount > 0) { + if (amount > 0) { ledger.doTransfer(payer, payee, amount); updateRecords(payer, fee, amount); } @@ -266,11 +270,15 @@ private boolean noCharge(AccountID payer, AccountID payee, TxnFeeType fee) { } private void updateRecords(AccountID source, TxnFeeType fee, long amount) { - if (source.equals(accessor.getPayer())) { - payerFeesCharged.put(fee, amount); - } - if (source.equals(submittingNode)) { - submittingNodeFeesCharged.put(fee, amount); + if (fee == THRESHOLD_RECORD) { + thresholdFeePayers.add(source); + } else { + if (source.equals(accessor.getPayer())) { + payerFeesCharged.put(fee, amount); + } + if (source.equals(submittingNode)) { + submittingNodeFeesCharged.put(fee, amount); + } } } } diff --git a/hedera-node/src/main/java/com/hedera/services/legacy/services/stats/HederaNodeStats.java b/hedera-node/src/main/java/com/hedera/services/legacy/services/stats/HederaNodeStats.java index 2089ee111408..c81ec5bfbfcf 100644 --- a/hedera-node/src/main/java/com/hedera/services/legacy/services/stats/HederaNodeStats.java +++ b/hedera-node/src/main/java/com/hedera/services/legacy/services/stats/HederaNodeStats.java @@ -51,7 +51,6 @@ public class HederaNodeStats { private static final double DEFAULT_HALF_LIFE = 10.0; public static final int UPDATE_PERIOD = 3000; - @Deprecated private static final String THRESHOLD_RECORDS_IN_STATE = "thresholdRecInState"; private final Logger log; diff --git a/hedera-node/src/main/java/com/hedera/services/records/FeeChargingRecordsHistorian.java b/hedera-node/src/main/java/com/hedera/services/records/FeeChargingRecordsHistorian.java index 13d53238da84..c222ed9d6c38 100644 --- a/hedera-node/src/main/java/com/hedera/services/records/FeeChargingRecordsHistorian.java +++ b/hedera-node/src/main/java/com/hedera/services/records/FeeChargingRecordsHistorian.java @@ -41,7 +41,9 @@ import java.util.function.Supplier; import static com.hedera.services.fees.TxnFeeType.CACHE_RECORD; +import static com.hedera.services.fees.TxnFeeType.THRESHOLD_RECORD; import static com.hedera.services.fees.charging.ItemizableFeeCharging.CACHE_RECORD_FEE; +import static com.hedera.services.fees.charging.ItemizableFeeCharging.THRESHOLD_RECORD_FEE; import static com.hedera.services.state.merkle.MerkleEntityId.fromAccountId; import static com.hedera.services.utils.EntityIdUtils.asAccount; import static com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS; @@ -106,7 +108,13 @@ public void addNewRecords() { var record = txnCtx.recordSoFar(); long cachingFeePaid = payForCaching(record); - if (cachingFeePaid > 0L) { + if (properties.shouldCreateThresholdRecords()) { + long thresholdRecordFee = fees.computeStorageFee(record); + getThreshXQualifiers(thresholdRecordFee); + feeCharging.setFor(THRESHOLD_RECORD, thresholdRecordFee); + payForThresholdRecords(); + } + if (feeCharging.numThresholdFeesCharged() > 0 || cachingFeePaid > 0L) { record = txnCtx.updatedRecordGiven(ledger.netTransfersInTxn()); } @@ -140,6 +148,40 @@ public void reviewExistingRecords() { expiries.resumeTrackingFrom(accounts.get()); } + private boolean qualifiesForRecord(AccountAmount adjustment, long recordFee) { + AccountID id = adjustment.getAccountID(); + if (ledger.isPendingCreation(id)) { + return false; + } + long balance = ledger.getBalance(id); + if (balance < recordFee) { + return false; + } + + long amount = adjustment.getAmount(); + return checkIfAmountUnderThreshold(amount, id); + } + + private boolean checkIfAmountUnderThreshold(long amount, AccountID id) { + if (amount < 0) { + return -1 * amount > ledger.fundsSentRecordThreshold(id); + } else { + return amount > ledger.fundsReceivedRecordThreshold(id); + } + } + + private void payForThresholdRecords() { + historyRecordQualifiers.forEach(id -> feeCharging.chargeParticipant(id, THRESHOLD_RECORD_FEE)); + } + + private void getThreshXQualifiers(long recordFee) { + ledger.netTransfersInTxn().getAccountAmountsList() + .stream() + .filter(aa -> qualifiesForRecord(aa, recordFee)) + .map(AccountAmount::getAccountID) + .forEach(historyRecordQualifiers::add); + } + private void createHistorical( Set ids, TransactionRecord record, From 025dce398ab0ff0a80bcd46eebac216e1562c4fb Mon Sep 17 00:00:00 2001 From: Neeharika-Sompalli Date: Mon, 14 Sep 2020 11:22:37 -0500 Subject: [PATCH 4/5] add Deprecated to comments --- hapi-proto/src/main/proto/CryptoCreate.proto | 4 ++-- hapi-proto/src/main/proto/CryptoGetInfo.proto | 4 ++-- hapi-proto/src/main/proto/CryptoUpdate.proto | 4 ++-- hapi-proto/src/main/proto/ResponseCode.proto | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hapi-proto/src/main/proto/CryptoCreate.proto b/hapi-proto/src/main/proto/CryptoCreate.proto index 8c27b556e950..c3afb58478ac 100644 --- a/hapi-proto/src/main/proto/CryptoCreate.proto +++ b/hapi-proto/src/main/proto/CryptoCreate.proto @@ -39,8 +39,8 @@ 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]; // The threshold amount (in tinybars) for which an account record is created for any send/withdraw transaction - uint64 receiveRecordThreshold = 7 [deprecated=true]; // The threshold amount (in tinybars) for which an account record is created for any receive/deposit transaction + 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 diff --git a/hapi-proto/src/main/proto/CryptoGetInfo.proto b/hapi-proto/src/main/proto/CryptoGetInfo.proto index 3859afb2f1c8..0fb7c7d9b778 100644 --- a/hapi-proto/src/main/proto/CryptoGetInfo.proto +++ b/hapi-proto/src/main/proto/CryptoGetInfo.proto @@ -50,9 +50,9 @@ message CryptoGetInfoResponse { 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 - // 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 + // [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]; - // 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 + // [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 diff --git a/hapi-proto/src/main/proto/CryptoUpdate.proto b/hapi-proto/src/main/proto/CryptoUpdate.proto index 0587c7c9523b..6e46bb749d56 100644 --- a/hapi-proto/src/main/proto/CryptoUpdate.proto +++ b/hapi-proto/src/main/proto/CryptoUpdate.proto @@ -40,11 +40,11 @@ message CryptoUpdateTransactionBody { 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; // 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; // 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) diff --git a/hapi-proto/src/main/proto/ResponseCode.proto b/hapi-proto/src/main/proto/ResponseCode.proto index 4b5688b8e746..c419e2ee9b8b 100644 --- a/hapi-proto/src/main/proto/ResponseCode.proto +++ b/hapi-proto/src/main/proto/ResponseCode.proto @@ -133,8 +133,8 @@ enum ResponseCodeEnum { 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]; // attempt to set negative receive record threshold - INVALID_SEND_RECORD_THRESHOLD=87 [deprecated=true]; // attempt to set negative send record threshold + 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 From 8c94dd2f6b239a9bd46ec5e04a0bc18187d9bb3f Mon Sep 17 00:00:00 2001 From: Neeharika-Sompalli Date: Mon, 14 Sep 2020 12:05:46 -0500 Subject: [PATCH 5/5] update HAPI.html --- hapi-proto/HAPI.html | 2362 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 2136 insertions(+), 226 deletions(-) diff --git a/hapi-proto/HAPI.html b/hapi-proto/HAPI.html index 79a032316309..82b7e9eb95e7 100644 --- a/hapi-proto/HAPI.html +++ b/hapi-proto/HAPI.html @@ -266,6 +266,18 @@

Table of Contents

MThresholdSignature +
  • + MTokenID +
  • + +
  • + MTokenRef +
  • + +
  • + MTokenRelationship +
  • +
  • MTopicID
  • @@ -283,6 +295,14 @@

    Table of Contents

    EHederaFunctionality +
  • + ETokenFreezeStatus +
  • + +
  • + ETokenKycStatus +
  • + @@ -626,6 +646,10 @@

    Table of Contents

    MCryptoGetAccountBalanceResponse +
  • + MTokenBalance +
  • + @@ -748,6 +772,10 @@

    Table of Contents

    MCryptoTransferTransactionBody +
  • + MTokenTransferList +
  • +
  • MTransferList
  • @@ -1174,6 +1202,213 @@

    Table of Contents

    + + + + +
  • + TokenBurnCoins.proto + +
  • + + +
  • + TokenCreate.proto + +
  • + + +
  • + TokenDelete.proto + +
  • + + +
  • + TokenFreeze.proto + +
  • + + +
  • + TokenGetInfo.proto + +
  • + + +
  • + TokenGrantKyc.proto + +
  • + + +
  • + TokenManagement.proto + +
  • + + +
  • + TokenMintCoins.proto + +
  • + + +
  • + TokenRevokeKyc.proto + +
  • + + +
  • + TokenService.proto + +
  • + + +
  • + TokenTransact.proto + +
  • + + +
  • + TokenUnfreeze.proto + +
  • + + +
  • + TokenWipeAccount.proto +
  • @@ -1306,6 +1541,21 @@

    Table of Contents

    + + + + +
  • + UncheckedSubmit.proto +
  • @@ -2171,8 +2421,8 @@

    ThresholdSignature

    -

    TopicID

    -

    Unique identifier for a topic (used by the consensus service)

    +

    TokenID

    +

    @@ -2185,21 +2435,21 @@

    TopicID

    - + - + - + - + @@ -2209,8 +2459,8 @@

    TopicID

    -

    TransactionFeeSchedule

    -

    The fees for a specific transaction or query based on the fee data.

    +

    TokenRef

    +

    shardNum int64

    The shard number (nonnegative)

    A nonnegative shard number

    realmNum int64

    The realm number (nonnegative)

    A nonnegative realm number

    topicNumtokenNum int64

    Unique topic identifier within a realm (nonnegative).

    A nonnegative token number

    @@ -2220,17 +2470,17 @@

    TransactionFeeSchedule

    - - + + - + - - + + - + @@ -2240,8 +2490,8 @@

    TransactionFeeSchedule

    -

    TransactionID

    -

    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.

    +

    TokenRelationship

    +

    hederaFunctionalityHederaFunctionalitytokenIdTokenID

    A particular transaction or query

    feeDataFeeDatasymbolstring

    Resource price coefficients

    @@ -2251,31 +2501,152 @@

    TransactionID

    - - + + - + - - + + - + - -
    transactionValidStartTimestamptokenIdTokenID

    The transaction is invalid if consensusTimestamp < transactionID.transactionStartValid

    accountIDAccountIDbalanceuint64

    The Account ID that paid for this transaction

    - - - - - - - -

    HederaFunctionality

    -

    The transactions and queries supported by Hedera Hashgraph.

    - + + + + + + + + + + + + + + + + + + + + + + +
    symbolstring

    kycStatusTokenKycStatus

    freezeStatusTokenFreezeStatus

    + + + + + +

    TopicID

    +

    Unique identifier for a topic (used by the consensus service)

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    shardNumint64

    The shard number (nonnegative)

    realmNumint64

    The realm number (nonnegative)

    topicNumint64

    Unique topic identifier within a realm (nonnegative).

    + + + + + +

    TransactionFeeSchedule

    +

    The fees for a specific transaction or query based on the fee data.

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    hederaFunctionalityHederaFunctionality

    A particular transaction or query

    feeDataFeeData

    Resource price coefficients

    + + + + + +

    TransactionID

    +

    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.

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    transactionValidStartTimestamp

    The transaction is invalid if consensusTimestamp < transactionID.transactionStartValid

    accountIDAccountID

    The Account ID that paid for this transaction

    + + + + + + + +

    HederaFunctionality

    +

    The transactions and queries supported by Hedera Hashgraph.

    + @@ -2533,6 +2904,142 @@

    HederaFunctionality

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameNumberDescription

    UncheckedSubmit55

    TokenCreate56

    TokenTransact57

    TokenGetInfo58

    TokenFreezeAccount59

    TokenUnfreezeAccount60

    TokenGrantKycToAccount61

    TokenRevokeKycFromAccount62

    TokenDelete63

    TokenUpdate64

    TokenMint65

    TokenBurn66

    TokenAccountWipe67

    + +

    TokenFreezeStatus

    +

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameNumberDescription
    FreezeNotApplicable0

    Frozen1

    Unfrozen2

    + +

    TokenKycStatus

    +

    + + + + + + + + + + + + + + + + + + + + + + + +
    NameNumberDescription
    KycNotApplicable0

    Granted1

    Revoked2

    @@ -4051,14 +4558,14 @@

    CryptoCreateTransactionBody

    sendRecordThreshold uint64 -

    The threshold amount (in tinybars) for which an account record is created for any send/withdraw transaction

    +

    [Deprecated]. The threshold amount (in tinybars) for which an account record is created for any send/withdraw transaction

    receiveRecordThreshold uint64 -

    The threshold amount (in tinybars) for which an account record is created for any receive/deposit transaction

    +

    [Deprecated]. The threshold amount (in tinybars) for which an account record is created for any receive/deposit transaction

    @@ -4100,19 +4607,45 @@

    CryptoCreateTransactionBody

    - - - - - - - - - - - -
    -

    CryptoDelete.proto

    Top + + +

    Fields with deprecated option

    + + + + + + + + + + + + + + + + + + + + +
    NameOption
    sendRecordThreshold

    true

    receiveRecordThreshold

    true

    + + + + + + + + + + + + + +
    +

    CryptoDelete.proto

    Top

    @@ -4276,6 +4809,44 @@

    CryptoGetAccountBalanceResponse

    The current balance, in tinybars

    + + tokenBalances + TokenBalance + repeated +

    + + + + + + + + + +

    TokenBalance

    +

    + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    tokenIdTokenID

    balanceuint64

    @@ -4505,14 +5076,14 @@

    CryptoGetInfoResponse.AccountIn generateSendRecordThreshold uint64 -

    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

    +

    [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

    generateReceiveRecordThreshold uint64 -

    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

    +

    [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

    @@ -4543,10 +5114,43 @@

    CryptoGetInfoResponse.AccountIn

    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)

    + + tokenRelationships + TokenRelationship + repeated +

    + + + + +

    Fields with deprecated option

    + + + + + + + + + + + + + + + + + + + + +
    NameOption
    generateSendRecordThreshold

    true

    generateReceiveRecordThreshold

    true

    + + @@ -4964,6 +5568,37 @@

    CryptoTransferTransactionBody

    +

    TokenTransferList

    +

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    tokenTokenID

    transfersAccountAmountrepeated

    + + + + +

    TransferList

    A list of accounts and amounts to transfer out of each account (negative) or into it (positive).

    @@ -5051,7 +5686,7 @@

    CryptoUpdateTransactionBody

    sendRecordThresholdWrapper google.protobuf.UInt64Value -

    The new threshold amount (in tinybars) for which an account record is created for any send/withdraw transaction

    +

    [Deprecated]. The new threshold amount (in tinybars) for which an account record is created for any send/withdraw transaction

    @@ -5065,7 +5700,7 @@

    CryptoUpdateTransactionBody

    receiveRecordThresholdWrapper google.protobuf.UInt64Value -

    The new threshold amount (in tinybars) for which an account record is created for any receive/deposit transaction.

    +

    [Deprecated]. The new threshold amount (in tinybars) for which an account record is created for any receive/deposit transaction.

    @@ -5122,11 +5757,21 @@

    Fields with deprecated option

    true

    + + sendRecordThresholdWrapper +

    true

    + + receiveRecordThreshold

    true

    + + receiveRecordThresholdWrapper +

    true

    + + receiverSigRequired

    true

    @@ -6213,6 +6858,13 @@

    NetworkService

    Retrieves the active versions of Hedera Services and HAPI proto

    + + uncheckedSubmit + Transaction + TransactionResponse +

    + + @@ -6361,6 +7013,13 @@

    Query

    + + tokenGetInfo + TokenGetInfoQuery + +

    + + @@ -6598,6 +7257,13 @@

    Response

    Semantic versions of Hedera Services and HAPI proto

    + + tokenGetInfo + TokenGetInfoResponse + +

    + + @@ -7148,13 +7814,13 @@

    ResponseCodeEnum

    INVALID_RECEIVE_RECORD_THRESHOLD 86 -

    attempt to set negative receive record threshold

    +

    [Deprecated]. attempt to set negative receive record threshold

    INVALID_SEND_RECORD_THRESHOLD 87 -

    attempt to set negative send record threshold

    +

    [Deprecated]. attempt to set negative send record threshold

    @@ -7322,7 +7988,7 @@

    ResponseCodeEnum

    UNAUTHORIZED 157 -

    An attempted operation was not authorized (ie - a deleteTopic for a topic with no adminKey).

    +

    An attempted operation was not authorized (ie - a deleteTopic for a topic with no adminKey, a tokenUpdate or tokenDelete for token with no adminKey).

    @@ -7363,104 +8029,266 @@

    ResponseCodeEnum

    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.

    - - - - - - - - - -
    -

    ResponseHeader.proto

    Top -
    -

    - - -

    ResponseHeader

    -

    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.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    FieldTypeLabelDescription
    nodeTransactionPrecheckCodeResponseCodeEnum

    Result of fee transaction precheck, saying it passed, or why it failed

    responseTypeResponseType

    The requested response is repeated back here, for convenience

    costuint64

    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)

    stateProofbytes

    The state proof for this information (if a state proof was requested, and is available)

    - - - - - - - - - - - - - -
    -

    SmartContractService.proto

    Top -
    -

    - - - - - - - - -

    SmartContractService

    -

    Transactions and queries for the file service.

    - - - - - + + + + + - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Method NameRequest TypeResponse TypeDescription
    ACCOUNT_FROZEN_FOR_TOKEN165

    createContractTransactionTransactionResponse

    Creates a contract

    TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED166

    updateContractTransactionINVALID_TOKEN_ID167

    INVALID_TOKEN_DIVISIBILITY168

    INVALID_TOKEN_FLOAT169

    INVALID_TREASURY_ACCOUNT_FOR_TOKEN170

    INVALID_TOKEN_SYMBOL171

    TOKEN_HAS_NO_FREEZE_KEY172

    TRANSFERS_NOT_ZERO_SUM_FOR_TOKEN173

    MISSING_TOKEN_SYMBOL174

    TOKEN_SYMBOL_TOO_LONG175

    TOKEN_SYMBOL_ALREADY_IN_USE176

    INVALID_TOKEN_REF177

    ACCOUNT_KYC_NOT_GRANTED_FOR_TOKEN178

    TOKEN_HAS_NO_KYC_KEY179

    INSUFFICIENT_TOKEN_BALANCE180

    TOKEN_WAS_DELETED181

    TOKEN_HAS_NO_SUPPLY_KEY182

    TOKEN_HAS_NO_WIPE_KEY183

    INVALID_TOKEN_MINT_AMOUNT184

    INVALID_TOKEN_BURN_AMOUNT185

    ACCOUNT_HAS_NO_TOKEN_RELATIONSHIP186

    CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT187

    INVALID_KYC_KEY188

    INVALID_WIPE_KEY189

    INVALID_FREEZE_KEY190

    INVALID_SUPPLY_KEY191

    + + + + + + + +
    +

    ResponseHeader.proto

    Top +
    +

    + + +

    ResponseHeader

    +

    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.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    nodeTransactionPrecheckCodeResponseCodeEnum

    Result of fee transaction precheck, saying it passed, or why it failed

    responseTypeResponseType

    The requested response is repeated back here, for convenience

    costuint64

    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)

    stateProofbytes

    The state proof for this information (if a state proof was requested, and is available)

    + + + + + + + + + + + + + +
    +

    SmartContractService.proto

    Top +
    +

    + + + + + + + + +

    SmartContractService

    +

    Transactions and queries for the file service.

    + + + + + + + + + + + + + + + + @@ -7480,52 +8308,970 @@

    SmartContractService

    - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Method NameRequest TypeResponse TypeDescription
    createContractTransactionTransactionResponse

    Creates a contract

    updateContractTransaction TransactionResponse

    Updates a contract with the content

    contractCallLocalMethodQueryResponse

    Calls a smart contract to be run on a single node

    contractCallLocalMethodQueryResponse

    Calls a smart contract to be run on a single node

    ContractGetBytecodeQueryResponse

    Retrieves the byte code of a contract

    getBySolidityIDQueryResponse

    Retrieves a contract by its Solidity address

    getTxRecordByContractIDQueryResponse

    Retrieves the 25-hour records stored for a contract

    deleteContractTransactionTransactionResponse

    Deletes a contract instance and transfers any remaining hbars to a specified receiver

    systemDeleteTransactionTransactionResponse

    Deletes a contract if the submitting account has network admin privileges

    systemUndeleteTransactionTransactionResponse

    Undeletes a contract if the submitting account has network admin privileges

    + + + + +
    +

    SystemDelete.proto

    Top +
    +

    + + +

    SystemDeleteTransactionBody

    +

    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.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    fileIDFileID

    The file ID of the file to delete, in the format used in transactions

    contractIDContractID

    The contract ID instance to delete, in the format used in transactions

    expirationTimeTimestampSeconds

    The timestamp in seconds at which the "deleted" file should truly be permanently deleted

    + + + + + + + + + + + + + +
    +

    SystemUndelete.proto

    Top +
    +

    + + +

    SystemUndeleteTransactionBody

    +

    Undelete a file or smart contract that was deleted by SystemDelete; requires a Hedera administrative multisignature.

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    fileIDFileID

    The file ID to undelete, in the format used in transactions

    contractIDContractID

    The contract ID instance to undelete, in the format used in transactions

    + + + + + + + + + + + + + +
    +

    Timestamp.proto

    Top +
    +

    + + +

    Timestamp

    +

    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)

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    secondsint64

    Number of complete seconds since the start of the epoch

    nanosint32

    Number of nanoseconds since the start of the last second

    + + + + + +

    TimestampSeconds

    +

    An exact date and time, with a resolution of one second (no nanoseconds).

    + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    secondsint64

    Number of complete seconds since the start of the epoch

    + + + + + + + + + + + + + +
    +

    TokenBurnCoins.proto

    Top +
    +

    + + +

    TokenBurnCoins

    +

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    tokenTokenRef

    amountuint64

    + + + + + + + + + + + + + +
    +

    TokenCreate.proto

    Top +
    +

    + + +

    TokenCreation

    +

    Create a new token, returning its id in the receipt.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    floatuint64

    The total number of tokens to put into circulation

    divisibilityuint32

    The number of unit into which each token may be subdivided

    treasuryAccountID

    The treasury account which should receive the initial float

    adminKeyKey

    The key which must sign to modify this token's properties

    kycKeyKey

    The key which must sign to grant or revoke KYC of an account for token transactions

    freezeKeyKey

    The key which must sign to freeze or unfreeze an account for token transactions

    wipeKeyKey

    The key which must sign to freeze or unfreeze an account for token transactions

    supplyKeyKey

    The key which must sign to freeze or unfreeze an account for token transactions

    freezeDefaultbool

    The default status (frozen or unfrozen) of Hedera accounts relative to this token

    kycDefaultbool

    The default KYC status (granted or revoked) of Hedera accounts relative to this token

    symbolstring

    The case-insensitive UTF-8 alphanumeric string identifying the token

    + + + + + + + + + + + + + +
    +

    TokenDelete.proto

    Top +
    +

    + + +

    TokenDeletion

    +

    + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    tokenTokenRef

    + + + + + + + + + + + + + +
    +

    TokenFreeze.proto

    Top +
    +

    + + +

    TokenFreeze

    +

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    tokenTokenRef

    accountAccountID

    + + + + + + + + + + + + + +
    +

    TokenGetInfo.proto

    Top +
    +

    + + +

    TokenGetInfoQuery

    +

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    headerQueryHeader

    tokenTokenRef

    + + + + + +

    TokenGetInfoResponse

    +

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    headerResponseHeader

    tokenInfoTokenInfo

    + + + + + +

    TokenInfo

    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    tokenIdTokenID

    symbolstring

    treasuryAccountID

    currentFloatuint64

    divisibilityuint32

    adminKeyKey

    kycKeyKey

    freezeKeyKey

    wipeKeyKey

    supplyKeyKey

    defaultFreezeStatusTokenFreezeStatus

    defaultKycStatusTokenKycStatus

    isDeletedbool

    + + + + + + + + + + + + + +
    +

    TokenGrantKyc.proto

    Top +
    +

    + + +

    TokenGrantKyc

    +

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    tokenTokenRef

    accountAccountID

    + + + + + + + + + + + + + +
    +

    TokenManagement.proto

    Top +
    +

    + + +

    TokenManagement

    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    tokenTokenRef

    treasuryAccountID

    adminKeyKey

    kycKeyKey

    freezeKeyKey

    wipeKeyKey

    supplyKeyKey

    symbolstring

    + + + + + + + + + + + + + +
    +

    TokenMintCoins.proto

    Top +
    +

    + + +

    TokenMintCoins

    +

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    tokenTokenRef

    amountuint64

    + + + + + + + + + + + + + +
    +

    TokenRevokeKyc.proto

    Top +
    +

    + + +

    TokenRevokeKyc

    +

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    tokenTokenRef

    accountAccountID

    + + + + + + + + + + + + + +
    +

    TokenService.proto

    Top +
    +

    + + + + + + + + +

    TokenService

    +

    The requests and responses for different network services.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + - + - + - + - + - + + + + + + + + @@ -7535,13 +9281,13 @@

    SmartContractService

    -

    SystemDelete.proto

    Top +

    TokenTransact.proto

    Top

    -

    SystemDeleteTransactionBody

    -

    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.

    +

    TokenTransfer

    +

    Method NameRequest TypeResponse TypeDescription
    mintTokenTransactionTransactionResponse

    burnTokenTransactionTransactionResponse

    createTokenTransactionTransactionResponse

    updateTokenTransactionTransactionResponse

    deleteTokenTransactionTransactionResponse

    ContractGetBytecodeQueryResponse

    Retrieves the byte code of a contract

    transferTokensTransactionTransactionResponse

    getBySolidityIDQueryResponse

    Retrieves a contract by its Solidity address

    wipeTokenAccountTransactionTransactionResponse

    getTxRecordByContractIDQueryResponse

    Retrieves the 25-hour records stored for a contract

    freezeTokenAccountTransactionTransactionResponse

    deleteContractunfreezeTokenAccount Transaction TransactionResponse

    Deletes a contract instance and transfers any remaining hbars to a specified receiver

    systemDeletegrantKycToTokenAccount Transaction TransactionResponse

    Deletes a contract if the submitting account has network admin privileges

    systemUndeleterevokeKycFromTokenAccount Transaction TransactionResponse

    Undeletes a contract if the submitting account has network admin privileges

    getTokenInfoQueryResponse

    @@ -7551,24 +9297,24 @@

    SystemDeleteTransactionBody

    - - + + - + - - + + - + - - + + - + @@ -7578,22 +9324,8 @@

    SystemDeleteTransactionBody

    - - - - - - - - -
    -

    SystemUndelete.proto

    Top -
    -

    - - -

    SystemUndeleteTransactionBody

    -

    Undelete a file or smart contract that was deleted by SystemDelete; requires a Hedera administrative multisignature.

    +

    TokenTransfers

    +

    fileIDFileIDaccountAccountID

    The file ID of the file to delete, in the format used in transactions

    contractIDContractIDamountsint64

    The contract ID instance to delete, in the format used in transactions

    expirationTimeTimestampSecondstokenTokenRef

    The timestamp in seconds at which the "deleted" file should truly be permanently deleted

    @@ -7603,17 +9335,10 @@

    SystemUndeleteTransactionBody

    - - - - - - - - - - - + + + + @@ -7632,13 +9357,13 @@

    SystemUndeleteTransactionBody

    -

    Timestamp.proto

    Top +

    TokenUnfreeze.proto

    Top

    -

    Timestamp

    -

    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)

    +

    TokenUnfreeze

    +

    fileIDFileID

    The file ID to undelete, in the format used in transactions

    contractIDContractID

    The contract ID instance to undelete, in the format used in transactions

    transfersTokenTransferrepeated

    @@ -7648,17 +9373,17 @@

    Timestamp

    - - + + - + - - + + - + @@ -7668,8 +9393,22 @@

    Timestamp

    -

    TimestampSeconds

    -

    An exact date and time, with a resolution of one second (no nanoseconds).

    + + + + + + + + +
    +

    TokenWipeAccount.proto

    Top +
    +

    + + +

    TokenWipeAccount

    +

    secondsint64tokenTokenRef

    Number of complete seconds since the start of the epoch

    nanosint32accountAccountID

    Number of nanoseconds since the start of the last second

    @@ -7679,10 +9418,17 @@

    TimestampSeconds

    - - + + - + + + + + + + + @@ -7990,6 +9736,90 @@

    TransactionBody

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    secondsint64tokenTokenRef

    Number of complete seconds since the start of the epoch

    accountAccountID

    uncheckedSubmitUncheckedSubmitBody

    tokenCreationTokenCreation

    tokenTransfersTokenTransfers

    tokenFreezeTokenFreeze

    tokenUnfreezeTokenUnfreeze

    tokenGrantKycTokenGrantKyc

    tokenRevokeKycTokenRevokeKyc

    tokenDeletionTokenDeletion

    tokenUpdateTokenManagement

    tokenMintTokenMintCoins

    tokenBurnTokenBurnCoins

    tokenWipeTokenWipeAccount

    @@ -8132,6 +9962,13 @@

    TransactionGetReceiptQuery

    The ID of the transaction for which the receipt is requested.

    + + includeDuplicates + bool + +

    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 <tt>INVALID_NODE_ACCOUNT</tt> nor <tt>INVALID_PAYER_SIGNATURE</tt>; <b>or</b>, if no such receipt exists, the receipt of processing the first transaction to reach consensus with the given transaction id..

    + + @@ -8160,7 +9997,14 @@

    TransactionGetReceiptResponse

    receipt TransactionReceipt -

    The receipt, indicating it reached consensus (and whether it succeeded or failed) or is currently unknown (because it hasn't reached consensus yet, or the transaction has expired already), and including the ID of any new account/file/instance created by that transaction.

    +

    Either the receipt of processing the first consensus transaction with the given id whose status was neither <tt>INVALID_NODE_ACCOUNT</tt> nor <tt>INVALID_PAYER_SIGNATURE</tt>; <b>or</b>, if no such receipt exists, the receipt of processing the first transaction to reach consensus with the given transaction id.

    + + + + duplicateTransactionReceipts + TransactionReceipt + repeated +

    The receipts of processing all consensus transaction with the same id as the distinguished receipt above, in chronological order.

    @@ -8208,6 +10052,13 @@

    TransactionGetRecordQuery

    The ID of the transaction for which the record is requested.

    + + includeDuplicates + bool + +

    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 <tt>INVALID_NODE_ACCOUNT</tt> nor <tt>INVALID_PAYER_SIGNATURE</tt>; <b>or</b>, if no such record exists, the record of processing the first transaction to reach consensus with the given transaction id..

    + + @@ -8236,7 +10087,14 @@

    TransactionGetRecordResponse

    transactionRecord TransactionRecord -

    The requested record

    +

    Either the record of processing the first consensus transaction with the given id whose status was neither <tt>INVALID_NODE_ACCOUNT</tt> nor <tt>INVALID_PAYER_SIGNATURE</tt>; <b>or</b>, if no such record exists, the record of processing the first transaction to reach consensus with the given transaction id.

    + + + + duplicateTransactionRecords + TransactionRecord + repeated +

    The records of processing all consensus transaction with the same id as the distinguished record above, in chronological order.

    @@ -8375,6 +10233,13 @@

    TransactionReceipt

    In the receipt of a ConsensusSubmitMessage, the version of the SHA-384 digest used to update the running hash.

    + + tokenId + TokenID + +

    In the receipt of a CreateToken, the id of the newly created token

    + + @@ -8469,6 +10334,13 @@

    TransactionRecord

    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.

    + + tokenTransferLists + TokenTransferList + repeated +

    + + @@ -8528,6 +10400,44 @@

    TransactionResponse

    + +
    +

    UncheckedSubmit.proto

    Top +
    +

    + + +

    UncheckedSubmitBody

    +

    Submit an arbitrary (serialized) Transaction to the network without prechecks. Requires superuser privileges.

    + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    transactionBytesbytes

    The serialized bytes of the Transaction to be submitted without prechecks

    + + + + + + + + + + + +

    Scalar Value Types