state.token.account.proto Maven / Gradle / Ivy
syntax = "proto3";
package proto;
/*-
*
* Hedera Network Services Protobuf
*
* Copyright (C) 2018 - 2023 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 "state/common.proto";
import "basic_types.proto";
option java_package = "com.hederahashgraph.api.proto.java";
// <<>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;
/**
* Representation of a Hedera Token Service account entity in the network Merkle tree.
*
* As with all network entities, account has a unique entity number represented as shard.realm.X.
* X can be an alias public key or an EVM address or a number.
*/
message Account {
/**
* The unique entity id of the account.
*/
AccountID account_id = 1;
/**
* The alias to use for this account, if any.
*/
bytes alias = 2;
/**
* (Optional) The key to be used to sign transactions from the account, if any.
* This key will not be set for hollow accounts until the account is finalized.
* This key should be set on all the accounts, except for immutable accounts (0.0.800 and 0.0.801).
*/
Key key = 3;
/**
* The expiration time of the account, in seconds since the epoch.
*/
int64 expiration_second = 4;
/**
* The balance of the account, in tiny-bars.
*/
int64 tinybar_balance = 5;
/**
* An optional description of the account with UTF-8 encoding up to 100 bytes.
*/
string memo = 6;
/**
* A boolean marking if the account has been deleted.
*/
bool deleted = 7;
/**
* The amount of hbars staked to the account.
*/
int64 staked_to_me = 8;
/**
* If this account stakes to another account, its value will be -1. It will
* be set to the time when the account starts staking to a node.
*/
int64 stake_period_start = 9;
/**
* ID of the account or node to which this account is staking.
*/
oneof staked_id {
/**
* ID of the new account to which this account is staking. If set to the sentinel 0.0.0 AccountID,
* this field removes this account's staked account ID.
*/
AccountID staked_account_id = 10;
/**
* ID of the new node this account is staked to. If set to the sentinel -1, this field
* removes this account's staked node ID.
*/
int64 staked_node_id = 11;
}
/**
* A boolean marking if the account declines rewards.
*/
bool decline_reward = 12;
/**
* A boolean marking if the account requires a receiver signature.
*/
bool receiver_sig_required = 13;
/**
* The token ID of the head of the linked list from token relations map for the account.
*/
TokenID head_token_id = 14;
/**
* The NftID of the head of the linked list from unique tokens map for the account.
*/
NftID head_nft_id = 15;
/**
* The serial number of the head NftID of the linked list from unique tokens map for the account.
*/
int64 head_nft_serial_number = 16;
/**
* The number of NFTs owned by the account.
*/
int64 number_owned_nfts = 17;
/**
* The maximum number of tokens that can be auto-associated with the account.
*/
int32 max_auto_associations = 18;
/**
* The number of used auto-association slots.
*/
int32 used_auto_associations = 19;
/**
* The number of tokens associated with the account. This number is used for
* fee calculation during renewal of the account.
*/
int32 number_associations = 20;
/**
* A boolean marking if the account is a smart contract.
*/
bool smart_contract = 21;
/**
* The number of tokens with a positive balance associated with the account.
* If the account has positive balance in a token, it can not be deleted.
*/
int32 number_positive_balances = 22;
/**
* The nonce of the account, used for Ethereum interoperability.
*/
int64 ethereum_nonce = 23;
/**
* The amount of hbars staked to the account at the start of the last rewarded period.
*/
int64 stake_at_start_of_last_rewarded_period = 24;
/**
* (Optional) The id of an auto-renew account, in the same shard and realm as the account, that
* has signed a transaction allowing the network to use its balance to automatically extend the account's
* expiration time when it passes.
*/
AccountID auto_renew_account_id = 25;
/**
* The number of seconds the network should automatically extend the account's expiration by, if the
* account has a valid auto-renew account, and is not deleted upon expiration.
* If this is not provided in an allowed range on account creation, the transaction will fail with INVALID_AUTO_RENEWAL_PERIOD.
* The default values for the minimum period and maximum period are 30 days and 90 days, respectively.
*/
int64 auto_renew_seconds = 26;
/**
* If this account is a smart-contract, number of key-value pairs stored on the contract.
* This is used to determine the storage rent for the contract.
*/
int32 contract_kv_pairs_number = 27;
/**
* (Optional) List of crypto allowances approved by the account.
* It contains account number for which the allowance is approved to and
* the amount approved for that account.
*/
repeated AccountCryptoAllowance crypto_allowances = 28;
/**
* (Optional) List of non-fungible token allowances approved for all by the account.
* It contains account number approved for spending all serial numbers for the given
* NFT token number using approved_for_all flag.
* Allowances for a specific serial number is stored in the NFT itself in state.
*/
repeated AccountApprovalForAllAllowance approve_for_all_nft_allowances = 29;
/**
* (Optional) List of fungible token allowances approved by the account.
* It contains account number for which the allowance is approved to and the token number.
* It also contains and the amount approved for that account.
*/
repeated AccountFungibleTokenAllowance token_allowances = 30;
/**
* The number of tokens for which this account is treasury
*/
uint32 number_treasury_titles = 31;
/**
* A flag indicating if the account is expired and pending removal.
* Only the entity expiration system task toggles this flag when it reaches this account
* and finds it expired. Before setting the flag the system task checks if the account has
* an auto-renew account with balance. This is done to prevent a zero-balance account with a funded
* auto-renew account from being treated as expired in the interval between its expiration
* and the time the system task actually auto-renews it.
*/
bool expired_and_pending_removal = 32;
/**
* The first key in the doubly-linked list of this contract's storage mappings;
* It will be null if if the account is not a contract or the contract has no storage mappings.
*/
bytes first_contract_storage_key = 33;
/**
* A pending airdrop ID at the head of the linked list for this account
* from the account airdrops map.
* The account airdrops are connected by including the "next" and "previous"
* `PendingAirdropID` in each `AccountAirdrop` message.
*
* This value SHALL NOT be empty if this account is "sender" for any
* pending airdrop, and SHALL be empty otherwise.
*/
PendingAirdropId head_pending_airdrop_id = 34;
}
/**
* Allowance granted by this account to a spender for a specific non-fungible token
* using ApproveForAll. This allows spender to spend all serial numbers for the given
* non-fungible token id.
*/
message AccountApprovalForAllAllowance {
TokenID token_id = 1;
AccountID spender_id = 2;
}
/**
* Allowance granted by this account to another account for a specific fungible token.
* This also contains the amount of the token that is approved for the account.
* This allows spender to spend the amount of tokens approved for the account.
*/
message AccountFungibleTokenAllowance {
TokenID token_id = 1;
AccountID spender_id = 2;
int64 amount = 3;
}
/**
* Allowance granted by this account to another account for an amount of hbars.
* This allows spender to spend the amount of hbars approved for the account.
*/
message AccountCryptoAllowance {
AccountID spender_id = 1;
int64 amount = 2;
}